Re: Expression Pruning in postgress

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: HarmeekSingh Bedi <harmeeksingh(at)gmail(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Expression Pruning in postgress
Date: 2011-07-13 15:59:21
Message-ID: 5621.1310572761@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

HarmeekSingh Bedi <harmeeksingh(at)gmail(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2011-07-13 16:03:33 Re: Need help understanding pg_locks
Previous Message Tom Lane 2011-07-13 15:44:36 Re: Need help understanding pg_locks