Re: Expression Pruning in postgress - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Expression Pruning in postgress
Date
Msg-id 5621.1310572761@sss.pgh.pa.us
Whole thread Raw
In response to Re: Expression Pruning in postgress  (HarmeekSingh Bedi <harmeeksingh@gmail.com>)
Responses Re: Expression Pruning in postgress
List pgsql-hackers
HarmeekSingh Bedi <harmeeksingh@gmail.com> writes:
>    1. May be I am mistaken Kindly  help me understand a bit more. I do agree
>    that passing datums up the node chain helps - but consider the case when
>    either Sort or Hash joins spills on disk - large columns that get written on
>    to the disk will still cause a lot of performance issues {as sorts spills
>    will detoast}

No, they don't.  What gets sent to disk is normally just the toast
pointer datum (19 bytes or whatever it is these days).

> I did make a fix at least to alleviate this case in the optimizer . But I am
> going to work on a more general approach of expression pruning based on the
> lifetime of an expression. Basically each node will either references or
> generate an expression. Any expression that is generated and is not
> referenced by any top on top will be eliminated.

Sounds like overkill.
        regards, tom lane


pgsql-hackers by date:

Previous
From: HarmeekSingh Bedi
Date:
Subject: Re: Expression Pruning in postgress
Next
From: Bruce Momjian
Date:
Subject: Re: Need help understanding pg_locks