Re: Inheritance, unique keys and performance - Mailing list pgsql-performance

From Tom Lane
Subject Re: Inheritance, unique keys and performance
Date
Msg-id 8606.1200257270@sss.pgh.pa.us
Whole thread Raw
In response to Re: Inheritance, unique keys and performance  ("Julian Scarfe" <julian@avbrief.com>)
List pgsql-performance
"Julian Scarfe" <julian@avbrief.com> writes:
> From: "Tom Lane" <tgl@sss.pgh.pa.us>
>> The
>> problem you've got is that you need a nestloop-with-inner-indexscan
>> plan type, where the inner side is an Append group (that is, an
>> inheritance tree) --- and 8.1 doesn't know how to create such a plan.
>> If you can update to 8.2 or later it should get better.

> Isn't test 3 (scalar subqueries) also a nestloop-with-inner-indexscan with
> an inner Append?

No.  The subquery is planned separately and sees the upper query's
variable as a pseudo-constant Param.  In neither query does the
planner think that a join is happening.

            regards, tom lane

pgsql-performance by date:

Previous
From: "Julian Scarfe"
Date:
Subject: Re: Inheritance, unique keys and performance
Next
From: Florian Weimer
Date:
Subject: Re: Best way to index IP data?