Re: Oddity with view (now with test case) - Mailing list pgsql-performance

From Tom Lane
Subject Re: Oddity with view (now with test case)
Date
Msg-id 21846.1226457290@sss.pgh.pa.us
Whole thread Raw
In response to Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby <jnasby@cashnetusa.com>)
List pgsql-performance
"Jim 'Decibel!' Nasby" <jnasby@cashnetusa.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

pgsql-performance by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Using index for IS NULL query
Next
From: Matthew Wakeling
Date:
Subject: Re: Using index for IS NULL query