Re: slow query performance

Поиск
Список
Период
Сортировка
От Robert Haas
Тема Re: slow query performance
Дата
Msg-id AANLkTilD4kN8bc7I3XauXEaryvsEZ-mXebx5yk71Vv6r@mail.gmail.com
обсуждение исходный текст
Ответ на Re: slow query performance  (Anj Adu <fotographs@gmail.com>)
Ответы Re: slow query performance  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-performance
On Thu, Jun 3, 2010 at 4:37 PM, Anj Adu <fotographs@gmail.com> wrote:
> Link to plan
>
> http://explain.depesz.com/s/kHa

Your problem is likely related to the line that's showing up in red:

Index Scan using dev4_act_dy_fact_2010_05_t3_thedate on
dev4_act_dy_fact_2010_05_t3 a (cost=0.00..94041.89 rows=204276
width=60) (actual time=164533.725..164533.725 rows=0 loops=1)
    * Index Cond: ((thedate >= '2010-05-22 00:00:00'::timestamp
without time area) AND (thedate <= '2010-05-22 00:00:00'::timestamp
without time area))
    * Filter: (node_id = $0)

This index scan is estimated to return 204,276 rows and actually
returned zero...  it might work better to rewrite this part of the
query as a join, if you can:

node_id=(select node_id from dev4_act_node where node='10.90.100.2')

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

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Large (almost 50%!) performance drop after upgrading to 8.4.4?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: slow query performance