agora inbox for pgsql-performance@postgresql.org  
help / color / mirror / Atom feed
From: Tomas Vondra <tv@fuzzy.cz>
To: Jayadevan M <Jayadevan.Maymala@ibsplc.com>
Cc: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
Cc: PGSQL Performance <pgsql-performance@postgresql.org>
Cc: pgsql-performance-owner@postgresql.org
Subject: Re: Query performance issue
Date: Wed, 31 Aug 2011 13:41:55 +0200
Message-ID: <30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com> (raw)
In-Reply-To: <OF3998413A.7B8C39D8-ON652578FD.003E1458-652578FD.003E387F@ibsplc.com>
References: <OF6B813C80.12B50253-ON652578FD.00310FC3-652578FD.00317C74@ibsplc.com>
	<4E5E0024.9070801@enterprisedb.com>
	<OF0B480C29.66982580-ON652578FD.003B9B44-652578FD.003BABAA@ibsplc.com>
	<OF3998413A.7B8C39D8-ON652578FD.003E1458-652578FD.003E387F@ibsplc.com>

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




view thread (57+ messages)  latest in thread

Message-ID: <30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com>
Permalink:  ../30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com/
Also on:    postgresql.org/message-id/30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tv@fuzzy.cz, Jayadevan.Maymala@ibsplc.com, heikki.linnakangas@enterprisedb.com, pgsql-performance-owner@postgresql.org
  Subject: Re: Query performance issue
  In-Reply-To: <30d4c8e39eef1ff30337242b4dedfd34.squirrel@sq.gransy.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox