От: Tom Lane
Тема: Re: speed of querry?
Дата: ,
Msg-id: 27509.1113461226@sss.pgh.pa.us
(см: обсуждение, исходный текст)
Ответ на: Re: speed of querry?  (Richard Huxton)
Ответы: Re: speed of querry?  ("Joel Fradkin")
Список: pgsql-performance

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

speed of querry?  ("Joel Fradkin", )
 Re: speed of querry?  (Richard Huxton, )
  Re: speed of querry?  ("Joel Fradkin", )
  Re: speed of querry?  (Tom Lane, )
   Re: speed of querry?  ("Joel Fradkin", )
    Re: speed of querry?  (Dawid Kuroczko, )
     Re: speed of querry?  ("Joel Fradkin", )
      Re: speed of querry?  (Dawid Kuroczko, )
       Re: speed of querry?  (Tom Lane, )
        Re: speed of querry?  ("Joel Fradkin", )
         Re: speed of querry?  ("Joel Fradkin", )
 Re: speed of querry?  ("Dave Held", )
  Re: speed of querry?  ("Joel Fradkin", )
   Re: speed of querry?  (Tom Lane, )
    Re: speed of querry?  ("Joel Fradkin", )
     Re: speed of querry?  (Tom Lane, )
 Re: speed of querry?  ("Dave Page", )
  Re: speed of querry?  ("Joel Fradkin", )

Richard Huxton <> writes:
> In the first, we match outer.clientnum to inner.clientnum, in the second
> it's "?column10?" - are you sure the query was identical in each case.
> I'm guessing the unidentified column in query 2 is the reason for the
> sort a couple of lines below it, which seems to take up a large chunk of
> time.

The "?column10?" is because EXPLAIN isn't excessively bright about
reporting references to outputs of lower plan nodes.  (Gotta fix that
sometime.)  The real point here is that the planner thought that a scan
plus sort would be faster than scanning an index that exactly matched
the sort order the Merge Join needed ... and it was wrong :-(

So this is just the usual sort of question of "are your stats up to
date, maybe you need to increase stats targets, or else play with
random_page_cost, etc" ...

            regards, tom lane


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

От: Richard van den Berg
Дата:
Сообщение: Foreign key slows down copy/insert
От: "Joel Fradkin"
Дата:
Сообщение: Re: speed of querry?