Re: Query Optimization

From: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Query Optimization
Date: 2010-04-08 14:03:29
Message-ID: 20100408140329.GD29013@a-kretschmer.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Andy Colson 2010-04-08 15:44:09 Re: How check execution plan of a function
Previous Message Kaloyan Iliev Iliev 2010-04-08 13:41:16 Re: Query Optimization