From: Khangelani Gama <kgama@argility.com>
To: Raghavendra <raghavendra.rao@enterprisedb.com>
Cc: pgsql-admin <pgsql-admin@postgresql.org>
Subject: Re: Postgres 9 : - How to interpret the EXPLAIN query results
Date: Wed, 25 Mar 2015 12:28:43 +0200
Message-ID: <80b319b3f6696a7f1672a4640f55e803@mail.gmail.com> (raw)
In-Reply-To: <CA+h6AhjktYYyGW2dEDctE5jR=z_5r=NKjrAF=XaSWZ6sosZaEw@mail.gmail.com>
References: <a5cf86e816f64005722ba22e878b3c44@mail.gmail.com>
<CA+h6AhjktYYyGW2dEDctE5jR=z_5r=NKjrAF=XaSWZ6sosZaEw@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>
*From:* Raghavendra [mailto:raghavendra.rao@enterprisedb.com]
*Sent:* 25 March 2015 12:04 PM
*To:* Khangelani Gama
*Cc:* pgsql-admin
*Subject:* Re: [ADMIN] Postgres 9 : - How to interpret the EXPLAIN query
results
On Wed, Mar 25, 2015 at 1:30 PM, Khangelani Gama <kgama@argility.com> wrote:
Hi
Please help, how can I interpret the following results of my EXPLAIN query
?, I can see that the query will through 18586018 rows, but what’s the
meaning of cost and width?
GroupAggregate (cost=762381141.96..768375132.77 rows=18586018 width=32)
Its like ..
NodeType (cost=startup-cost..total-cost rows=plan rows width=bytes per-row)
Documentation has briefed well on the explain output. Here's example.
Thanks to all, but if this total cost is the total time it will take to
retrieve the output then is it in minutes or milliseconds? If it’s in
milliseconds does it mean that it take about 213 hrs for a total of
768375132.77
postgres=# explain select * from foo;
QUERY PLAN
-----------------------------------------------------------
Seq Scan on foo (cost=0.00..5770.01 rows=400001 width=4)
(1 row)
postgres=# EXPLAIN (FORMAT JSON) SELECT * FROM foo;
QUERY PLAN
--------------------------------
[ +
{ +
"Plan": { +
"Node Type": "Seq Scan",+
"Relation Name": "foo", +
"Alias": "foo", +
"Startup Cost": 0.00, +
"Total Cost": 5770.01, +
"Plan Rows": 400001, +
"Plan Width": 4 +
} +
} +
]
(1 row)
http://www.postgresql.org/docs/9.3/static/sql-explain.html
---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/
CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the
addressee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries.
Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the
intended addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its
subsidiaries distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other
than strictly for business purposes.
CONFIDENTIALITY NOTICE
The contents of and attachments to this e-mail are intended for the addressee only, and may contain the confidential
information of Argility (Proprietary) Limited and/or its subsidiaries. Any review, use or dissemination thereof by anyone
other than the intended addressee is prohibited.If you are not the intended addressee please notify the writer immediately
and destroy the e-mail. Argility (Proprietary) Limited and its subsidiaries distance themselves from and accept no liability
for unauthorised use of their e-mail facilities or e-mails sent other than strictly for business purposes.
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-admin@postgresql.org
Cc: kgama@argility.com, raghavendra.rao@enterprisedb.com
Subject: Re: Postgres 9 : - How to interpret the EXPLAIN query results
In-Reply-To: <80b319b3f6696a7f1672a4640f55e803@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox