Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?

От: Kevin Grittner
Тема: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?
Дата: ,
Msg-id: 4B752934020000250002F24E@gw.wicourts.gov
(см: обсуждение, исходный текст)
Ответ на: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Karl Denninger)
Ответы: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Karl Denninger)
Список: pgsql-performance

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

512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
 Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
  Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Pavel Stehule, )
  Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Robert Haas, )
   Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  ("Jorge Montero", )
   Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
    Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Tom Lane, )
     Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
     Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
    Re: Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Robert Haas, )
 Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  ("Kevin Grittner", )
  Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Karl Denninger, )
   Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  ("Kevin Grittner", )
    Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Karl Denninger, )
     Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  ("Kevin Grittner", )
     Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Tom Lane, )
      Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )
       Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Pierre Frédéric Caillaud<>, )
       Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Robert Haas, )
  Re: 512,600ms query becomes 7500ms... but why? Postgres 8.3 query planner quirk?  (Bryce Nesbitt, )

Karl Denninger <> wrote:
Kevin Grittner wrote:

>> I suspect that the above might do pretty well in 8.4.

> "Exists" can be quite slow.  So can "not exists"
>
> See if you can re-write it using a sub-select - just replace the
> "exists ...." with "(select ...) is not null"
>
> Surprisingly this often results in a MUCH better query plan under
> Postgresql.  Why the planner evaluates it "better" eludes me (it
> shouldn't) but the differences are often STRIKING - I've seen
> factor-of-10 differences in execution performance.

Have you seen such a difference under 8.4?  Can you provide a
self-contained example?

-Kevin


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

От: "Kevin Grittner"
Дата:
Сообщение: Re: Almost infinite query -> Different Query Plan when changing where clause value
От: Greg Smith
Дата:
Сообщение: Re: moving pg_xlog -- yeah, it's worth it!