Re: Query performance issue

From: "Tomas Vondra" <tv(at)fuzzy(dot)cz>
To: "Jayadevan M" <Jayadevan(dot)Maymala(at)ibsplc(dot)com>
Cc: "Heikki Linnakangas" <heikki(dot)linnakangas(at)enterprisedb(dot)com>, "PGSQL Performance" <pgsql-performance(at)postgresql(dot)org>, pgsql-performance-owner(at)postgresql(dot)org
Subject: Re: Query performance issue
Date: 2011-08-31 11:41:55
Message-ID: 30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jayadevan M 2011-08-31 11:57:21 Re: Query performance issue
Previous Message Venkat Balaji 2011-08-31 11:32:58 Re: Query performance issue