Re: Possible to improve query plan?

От: Kevin Grittner
Тема: Re: Possible to improve query plan?
Дата: ,
Msg-id: 4D3D59810200002500039B05@gw.wicourts.gov
(см: обсуждение, исходный текст)
Ответ на: Re: Possible to improve query plan?  (Robert Haas)
Ответы: Re: Possible to improve query plan?  (Tom Lane)
Список: pgsql-performance

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

Possible to improve query plan?  (Jeremy Palmer, )
   Re: Possible to improve query plan?  (Andy Colson, )
    Re: Possible to improve query plan?  (Jeremy Palmer, )
   Re: Possible to improve query plan?  ("Ing. Marcos Ortiz Valmaseda", )
    Re: Possible to improve query plan?  (Jeremy Palmer, )
   Re: Possible to improve query plan?  ("Kevin Grittner", )
    Re: Possible to improve query plan?  (Robert Haas, )
     Re: Possible to improve query plan?  ("Kevin Grittner", )
      Re: Possible to improve query plan?  (Tom Lane, )
       Re: Possible to improve query plan?  ("Kevin Grittner", )
        Re: Possible to improve query plan?  (Jeremy Palmer, )
         Re: Possible to improve query plan?  ("Kevin Grittner", )
          Re: Possible to improve query plan?  (Cédric Villemain, )
         Re: Possible to improve query plan?  ("Kevin Grittner", )
          Re: Possible to improve query plan?  (Jeremy Palmer, )
     Re: Possible to improve query plan?  (Tom Lane, )

Robert Haas <> wrote:

> But isn't 13.5 seconds awfully slow to scan 149557 rows?  The sort
> is sorting 23960kB.  Dividing that by 149557 rows gives ~169
> bytes/per row

You're right.  I would expect 9 ms as per tuple as a worst case if
it doesn't need to go to TOAST data.  Caching, multiple rows per
page, or adjacent pages should all tend to bring it down from there.
How does it get to 90 ms per row with rows that narrow?

Is the table perhaps horribly bloated?  Jeremy, did you try my
suggestion of using CLUSTER on the index which will tend to be more
selective?

-Kevin


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

От: Jeremy Palmer
Дата:
Сообщение: Re: Possible to improve query plan?
От: "Kevin Grittner"
Дата:
Сообщение: Re: Possible to improve query plan?