Re: Oddity with view (now with test case)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Jim 'Decibel!' Nasby" <jnasby(at)cashnetusa(dot)com>
Cc: Richard Huxton <dev(at)archonet(dot)com>, postgresql performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Oddity with view (now with test case)
Date: 2008-11-12 02:34:50
Message-ID: 21846.1226457290@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

"Jim 'Decibel!' Nasby" <jnasby(at)cashnetusa(dot)com> writes:
> So here's something odd... in both 8.3 and HEAD from a while ago it
> gives a better plan for SELECT * than for SELECT count(*):

The short answer is that the Subquery Scan nodes can be dropped out
when they are no-ops, which is to say producing the same set of columns
their input produces (and not testing any filter conditions, but that's
not relevant here). SELECT count(*) doesn't want to know about any
columns so the output of the UNION arm doesn't match ...

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Julien Theulier 2008-11-12 13:22:47 Index usage with sub select or inner joins
Previous Message Scott Marlowe 2008-11-11 23:34:42 Re: Using index for IS NULL query