Re: Explain Analyze understanding

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Explain Analyze understanding
Date: 2011-08-24 16:42:35
Message-ID: 4E5529FB.9020504@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 08/24/11 9:18 AM, Carlos Henrique Reimer wrote:
> I need to improve performance for a particular SQL command but facing
> difficulties to understand the explain results.

you're joining like 50 tables in nested selects, getting 200 rows, and
its only taking 3.5 seconds? where's the problem?

you can paste EXPLAIN output into http://explain.depesz.com and get
output like http://explain.depesz.com/s/hfWp which helps format it for
better understanding.

in this case, most of the time (3.35s worth) appears to be spent on
sorts and an nidex scan inside an inner merge join thats processing
77000 rows.

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message c k 2011-08-24 17:06:37 Re: postgresql server crash on windows 7 when using plpython
Previous Message Richard Broersma 2011-08-24 16:30:41 Feature Request: DDL + RegExp - definitions