Re: What is the best way to optimize the query.

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: What is the best way to optimize the query.
Дата
Msg-id AANLkTinh4d6+0t9=0on28O_2eqSx+y=UNZX9iiptjAX6@mail.gmail.com
обсуждение исходный текст
Ответ на What is the best way to optimize the query.  (Srikanth <srikanth@inventum.net>)
Список pgsql-performance
On Sat, Jul 17, 2010 at 4:50 AM, Srikanth <srikanth@inventum.net> wrote:
> I am sending u the query along with execution plan. Please help

Looks to me like your biggest problem is right here:

"                                                        ->  Seq Scan
on subs s  (cost=0.00..5599.42 rows=58313 width=69) (actual
time=409.370..153354.835 rows=146954 loops=1)"
"                                                              Filter:
(CASE WHEN ((status = 0) AND issubsexpired(subsno)) THEN 15 ELSE
status END <= 15)"

1ms/row is pretty slow, so I'm guessing that the issubsexpired()
function is not too speedy.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise Postgres Company

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Linux Filesystems again - Ubuntu this time
Следующее
От: Whit Armstrong
Дата:
Сообщение: Re: Linux Filesystems again - Ubuntu this time