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 <Rainer.Pruy@Acrys.COM>)
Ответы Re: Query slowing down significantly??
Список pgsql-performance
Rainer Pruy <Rainer.Pruy@Acrys.COM> 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 по дате отправления:

Предыдущее
От: Rainer Pruy
Дата:
Сообщение: Re: Query slowing down significantly??
Следующее
От: Rainer Pruy
Дата:
Сообщение: Re: Query slowing down significantly??