От: Tom Lane
Тема: Re: plpgsql plan cache
Дата: ,
Msg-id: 1801.1266873658@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: plpgsql plan cache  (Joel Jacobson)
Список: pgsql-performance

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

plpgsql plan cache  (Joel Jacobson, )
 Re: plpgsql plan cache  ("Pierre C", )
  Re: plpgsql plan cache  (Joel Jacobson, )
   Re: plpgsql plan cache  (Tom Lane, )
   Re: plpgsql plan cache  (Nikolas Everett, )
    Re: plpgsql plan cache  (Joel Jacobson, )
 Re: plpgsql plan cache  ("Pierre C", )

Joel Jacobson <> writes:
> Hm, it is strange the query planner is using two different strategies
> for the same query?

They're not the same query.  One plan is generic for any value of the
parameters, the other is chosen for specific values of those parameters.
In particular, the unparameterized query depends very strongly on the
knowledge that not many rows will meet the RecordDate range constraint.
If you picked dates that were further apart you'd probably get something
that looked more like the other plan.

            regards, tom lane


В списке pgsql-performance по дате сообщения:

От: Dave Crooke
Дата:
Сообщение: Advice requested on structuring aggregation queries
От: Joe Conway
Дата:
Сообщение: Re: Advice requested on structuring aggregation queries