Re: Limit + group + join

От: Tom Lane
Тема: Re: Limit + group + join
Дата: ,
Msg-id: 9501.1125071193@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: Limit + group + join  (Mark Kirkwood)
Ответы: Re: Limit + group + join  (Mark Kirkwood)
Re: Limit + group + join  (Mark Kirkwood)
Re: Limit + group + join  (Greg Stark)
Список: pgsql-performance

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

Limit + group + join  (Tobias Brox, )
 Re: Limit + group + join  ("Jeffrey W. Baker", )
  Re: Limit + group + join  (Tobias Brox, )
  Re: Limit + group + join  ("Jeffrey W. Baker", )
 Re: Limit + group + join  (Mark Kirkwood, )
  Re: Limit + group + join  (Tobias Brox, )
  Re: Limit + group + join  (Stephan Szabo, )
  Re: Limit + group + join  (Tom Lane, )
   Re: Limit + group + join  (Mark Kirkwood, )
    Re: Limit + group + join  (Tom Lane, )
   Re: Limit + group + join  (Mark Kirkwood, )
    Re: Limit + group + join  (Tom Lane, )
     Re: Limit + group + join  (Mark Kirkwood, )
      Re: Limit + group + join  (Tobias Brox, )
   Re: Limit + group + join  (Greg Stark, )
 Re: Limit + group + join  ("Merlin Moncure", )
 Re: Limit + group + join  ("Merlin Moncure", )

Mark Kirkwood <> writes:
> What is interesting is why this plan is being rejected...

Which PG version are you using exactly?  That mistake looks like an
artifact of the 8.0 "fuzzy plan cost" patch, which we fixed recently:
http://archives.postgresql.org/pgsql-committers/2005-07/msg00474.php

But Tobias wasn't happy with 7.4 either, so I'm not sure that the fuzzy
cost issue explains his results.

As far as the "desc" point goes, the problem is that mergejoins aren't
capable of dealing with backward sort order, so a merge plan isn't
considered for that case (or at least, it would have to have a sort
after it, which pretty much defeats the point for a fast-start plan).
I have some ideas about fixing this but it won't happen before 8.2.

            regards, tom lane


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

От: Arjen van der Meijden
Дата:
Сообщение: Re: Inefficient queryplan for query with intersectable
От: Ümit Öztosun
Дата:
Сообщение: Weird performance drop after VACUUM