Re: Query performance issue - Mailing list pgsql-performance

From Tomas Vondra
Subject Re: Query performance issue
Date
Msg-id 30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com
Whole thread Raw
In response to Re: Query performance issue  (Jayadevan M <Jayadevan.Maymala@ibsplc.com>)
Responses Re: Query performance issue  (Jayadevan M <Jayadevan.Maymala@ibsplc.com>)
List pgsql-performance
On 31 Srpen 2011, 13:19, Jayadevan M wrote:
> Hello,
>
>> >
>> > Please run EXPLAIN ANALYZE on the query and post that, it's hard to
> say
>> > what's wrong from just the query plan, without knowing where the time
> is
>> > actually spent.
>> Here is the explain analyze
>> http://explain.depesz.com/s/MY1
> Going through the url tells me that statistics may be off. I will try
> analyzing the tables. That should help?
> Regards,
> Jayadevan

That could help, but not necessarily.

A really interesting part is the sort near the bottom -

->  Sort  (cost=1895.95..1896.49 rows=215 width=61) (actual
time=25.926..711784.723 rows=2673340321 loops=1)
    Sort Key: memmst.memshpsta
    Sort Method:  quicksort  Memory: 206kB
    ->  Nested Loop  (cost=0.01..1887.62 rows=215 width=61) (actual
time=0.088..23.445 rows=1121 loops=1)

How can a sort ge 1121 rows at the input and return 2673340321 rows at the
output? Not sure where this comes from.

BTW what PostgreSQL version is this?

Tomas


pgsql-performance by date:

Previous
From: Venkat Balaji
Date:
Subject: Re: Query performance issue
Next
From: Jayadevan M
Date:
Subject: Re: Query performance issue