Re: Query Optimization - Mailing list pgsql-performance

From A. Kretschmer
Subject Re: Query Optimization
Date
Msg-id 20100408140329.GD29013@a-kretschmer.de
Whole thread Raw
In response to Query Optimization  (Kaloyan Iliev Iliev)
List pgsql-performance
In response to Kaloyan Iliev Iliev :
> Hi,
> Can anyone suggest why this query so slow.


>                        ->  Index Scan using
> ms_commands_history_ms_device_id_idx on ms_commands_history ch
> (cost=0.00..4.33 rows=1 width=8) (actual time=0.163..25254.004 rows=9807
> loops=1)

Estimated rows: 1, actual rows: 9807, that's a BIG difference and,
maybe, your problem.

Btw.: your explain is hard to read (line-wrapping). It's better to
attach the explain as an own file...


Andreas
--
Andreas Kretschmer
Kontakt:  Heynitz: 035242/47150,   D1: 0160/7141639 (mehr: -> Header)
GnuPG: 0x31720C99, 1006 CCB4 A326 1D42 6431  2EB0 389D 1DC2 3172 0C99

pgsql-performance by date:

Previous
From: Alan Hodgson
Date:
Subject: Re: Occasional giant spikes in CPU load
Next
From: Andy Colson
Date:
Subject: Re: How check execution plan of a function