Package gavo :: Package utils :: Module pgexplain
[frames] | no frames]

Module pgexplain

source code

Parsing Postgres query plans (somewhat).

Functions
 
parseQueryPlan(pgPlan)
returns a parsed query plan from an iterator returning postgres explain lines.
source code
Variables
  __package__ = 'gavo.utils'
Function Details

parseQueryPlan(pgPlan)

source code 

returns a parsed query plan from an iterator returning postgres explain lines.

pgPlan usually is a cursor resulting from an EXPLAIN query.

The returned query plan is a tuple tree containing nodes of (op type, op dict, (children)), where op dict contains key-value pairs for things like cost, rows, etc.