Expression Pruning in postgress - Mailing list pgsql-hackers

From HarmeekSingh Bedi
Subject Expression Pruning in postgress
Date
Msg-id CALLwk6v4OwMbb6+Rr18hCvC+-Y4RY6KcVV1a2QxPTsz0pde6pg@mail.gmail.com
Whole thread Raw
Responses Re: Expression Pruning in postgress
List pgsql-hackers
Hi .
 Apology for the bandwith. Did not know who to ask the question . I
was interested in a brief detail on how postgress does expression
pruning between nodes . The basic question is as follows

Scenerio
  In a plan where Node 1 is parent {say join) and Node 2 is child
(say scan)  . If node 1 has a expression say foo(column) then scan
will project 'column'  for sure and join will     evaluate foo(column).  Now if the node above join does not need
column ? how does postgress remove the column from join's projection
list . I am seeing that it does not in many     cases specially when sort appears above.
Question    In general is there something in the code that can process a plan
tree and find out where expressions are generated and where there
references are not required - thus removing expressions not needed .
In my case the column is a huge column and hence it will matter if it
is removed from the projection list as soon as possible ?

Any insights welcome and thanks for all help

Regards
Harmeek


pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: dropping table in testcase alter_table.sql
Next
From: Pavel Stehule
Date:
Subject: Re: patch: enhanced get diagnostics statement 2