pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Julian Scarfe <julian@avbrief.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Inheritance, unique keys and performance
Date: Sun, 13 Jan 2008 15:47:50 -0500
Message-ID: <8606.1200257270@sss.pgh.pa.us> (raw)
In-Reply-To: <01fb01c8561a$76d6b4a0$0600a8c0@Wilbur>
References: <01a301c85552$24ab6270$0600a8c0@Wilbur>
	<21684.1200170118@sss.pgh.pa.us>
	<01b601c855c4$8ed20a60$0600a8c0@Wilbur>
	<7212.1200250003@sss.pgh.pa.us>
	<01fb01c8561a$76d6b4a0$0600a8c0@Wilbur>

"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



view thread (6+ messages)

Message-ID: <8606.1200257270@sss.pgh.pa.us>
Permalink:  ../8606.1200257270@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/8606.1200257270@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, julian@avbrief.com
  Subject: Re: Inheritance, unique keys and performance
  In-Reply-To: <8606.1200257270@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox