Re: Query slowing down significantly??

От: Tom Lane
Тема: Re: Query slowing down significantly??
Дата: ,
Msg-id: 20628.1267467300@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: Query slowing down significantly??  (Rainer Pruy)
Ответы: Re: Query slowing down significantly??  (Rainer Pruy)
Список: pgsql-performance

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

Query slowing down significantly??  (Rainer Pruy, )
 Re: Query slowing down significantly??  (Tom Lane, )
  Re: Query slowing down significantly??  (Rainer Pruy, )
   Re: Query slowing down significantly??  (Tom Lane, )
    Re: Query slowing down significantly??  (Rainer Pruy, )
     Re: Query slowing down significantly??  (Kris Jurka, )
   Re: Query slowing down significantly??  (Yeb Havinga, )

Rainer Pruy <> writes:
> The prepared statement gives:
> ...
> And that is quite a bad plan given the current distribution of values.

Yeah.  The planner really needs to know the actual parameter values in
order to pick the best plan for this case.

One thing that you might be able to do to avoid giving up on prepared
statements entirely is to use an "unnamed" rather than named prepared
statement here.  That will lead to the query plan being prepared only
when the parameter values are made available, rather than in advance.
It'd depend on what client library you're using whether this is a simple
change or not.

            regards, tom lane


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

От: Yeb Havinga
Дата:
Сообщение: Re: Query slowing down significantly??
От: Bruce Momjian
Дата:
Сообщение: Re: SSD + RAID