Re: The science of optimization in practical terms? - Mailing list pgsql-hackers

From Tom Lane
Subject Re: The science of optimization in practical terms?
Date
Msg-id 27636.1235000228@sss.pgh.pa.us
Whole thread Raw
In response to Re: The science of optimization in practical terms?  (Simon Riggs <simon@2ndQuadrant.com>)
List pgsql-hackers
Simon Riggs <simon@2ndQuadrant.com> writes:
> On Wed, 2009-02-18 at 15:32 -0500, Tom Lane wrote:
>> An idea that I think has been mentioned before is to try to identify
>> cases where we can *prove* there is at most one row emitted by a
>> sub-path (eg, because of a unique index, DISTINCT subplan, etc).

> Proof seems best way forward. IIRC the reason we didn't do this before
> HOT is that unique index scans did often return many more than one row.

But those extra tuples didn't make it up to the point of the join, so
they weren't really a problem for nestloop speed.  IMO the reason this
hasn't been done to date is that until recently we didn't have any
mechanism to ensure a plan got invalidated if some constraint it was
depending on (like uniqueness) went away.  Now we do, so it would be
safe to rely on the constraint for proof purposes.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Re: [COMMITTERS] pgsql: Start background writer during archive recovery.
Next
From: Adriano Lange
Date:
Subject: Re: graph representation of data structures in optimizer