Re: Oddity with view (now with test case)

От: Tom Lane
Тема: Re: Oddity with view (now with test case)
Дата: ,
Msg-id: 21846.1226457290@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby)
Список: pgsql-performance

Скрыть дерево обсуждения

Oddity with view  (Jim 'Decibel!' Nasby, )
 Re: Oddity with view  (Tom Lane, )
  Re: Oddity with view  (Jim 'Decibel!' Nasby, )
   Re: Oddity with view  (Richard Huxton, )
    Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby, )
     Re: Oddity with view (now with test case)  (Tom Lane, )
      Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby, )
       Re: Oddity with view (now with test case)  (Tom Lane, )
        Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby, )
         Re: Oddity with view (now with test case)  (Tom Lane, )
          Re: Oddity with view (now with test case)  (Jim 'Decibel!' Nasby, )
           Re: Oddity with view (now with test case)  (Tom Lane, )
   Re: Oddity with view  (Tom Lane, )

"Jim 'Decibel!' Nasby" <> 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 по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Oddity with view (now with test case)
От: Matthew Wakeling
Дата:
Сообщение: Re: Using index for IS NULL query