Re: 8.3 planner handling of IS NULL in aggregations

Поиск
Список
Период
Сортировка
От Sam Mason
Тема Re: 8.3 planner handling of IS NULL in aggregations
Дата
Msg-id 20080704172237.GA2572@frubble.xen.chris-lamb.co.uk
обсуждение исходный текст
Ответ на Re: 8.3 planner handling of IS NULL in aggregations  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Fri, Jul 04, 2008 at 12:37:48PM -0400, Tom Lane wrote:
> Yeah, estimate_num_groups doesn't have any special knowledge about IS
> NULL -- it just sees this as "an expression involving col".  The
> general assumption about that is that the expression doesn't reduce
> the number of groups (think "col + 1" for example).  In general I'd
> rather it overestimated the number of groups than underestimated,
> so I don't think this heuristic is really wrong.

Hum, I thought it tried harder than that---I remembered date_trunc doing
special things, but it doesn't seem to.  Ah well!

> Putting in a special case for IS NULL seems a bit silly, but maybe
> checking for a boolean result type would cover enough real-world
> uses to be worth the trouble?  Not sure.

Sounds sensible.  It would generalize nicely to the new enum types as
well, use the minimum of the expected number of rows or the size of the
result type's domain.


  Sam

В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: 8.3 planner handling of IS NULL in aggregations
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: [Postgresql 8.2.3] autovacuum starting up even after disabling ?