Re: Extremely irregular query performance

От: Tom Lane
Тема: Re: Extremely irregular query performance
Дата: ,
Msg-id: 28999.1137020585@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Extremely irregular query performance  (Jean-Philippe Côté<>)
Ответы: Re: Extremely irregular query performance  (Jean-Philippe Côté<>)
Список: pgsql-performance

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

Extremely irregular query performance  (Jean-Philippe Côté<>, )
 Re: Extremely irregular query performance  (Tom Lane, )
  Re: Extremely irregular query performance  (Jean-Philippe Côté<>, )
   Re: Extremely irregular query performance  (Mark Lewis, )
   Re: Extremely irregular query performance  (Tom Lane, )
    Re: Extremely irregular query performance  (Simon Riggs, )
     Re: Extremely irregular query performance  (Kenneth Marshall, )
     Re: Extremely irregular query performance  (Bruce Momjian, )
      Re: Extremely irregular query performance  (Tom Lane, )
       Re: Extremely irregular query performance  (Bruce Momjian, )
 Re: Extremely irregular query performance  (Scott Marlowe, )
 Re: Extremely irregular query performance  (Jean-Philippe Cote, )
  Re: Extremely irregular query performance  (Bruce Momjian, )
  Re: Extremely irregular query performance  (Kenneth Marshall, )

=?iso-8859-1?Q?Jean-Philippe_C=F4t=E9?= <> writes:
> I'm running version 8.1 on a dedicated Sun v20 server (2 AMD x64's)
> with 4Gb of RAM. I have recently noticed that the performance of
> some more complex queries is extremely variable and irregular.
> For example, I currently have a query that returns a small number
> of rows (5) by joining a dozen of tables.

A dozen tables?  You're exceeding the geqo_threshold and getting a plan
that has some randomness in it.  You could either increase
geqo_threshold if you can stand the extra planning time, or try
increasing geqo_effort to get it to search a little harder and hopefully
find a passable plan more often.  See

http://www.postgresql.org/docs/8.1/static/geqo.html
http://www.postgresql.org/docs/8.1/static/runtime-config-query.html#RUNTIME-CONFIG-QUERY-GEQO

I'm kinda surprised that you don't get better results with the default
settings.  We could tinker some more with the defaults, if you can
provide evidence about better values ...

            regards, tom lane


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

От: Tom Lane
Дата:
Сообщение: Re: indexes on primary and foreign keys
От: Simon Riggs
Дата:
Сообщение: Re: Extremely irregular query performance