How to use EXPLAIN (TIMING)

From: Robins Tharakan <tharakan(at)gmail(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: How to use EXPLAIN (TIMING)
Date: 2013-04-12 15:14:02
Message-ID: CAEP4nAzWMzZ08Bzo4078VREXmEp0zP2f0xjP-pB1vb4XZtE3Uw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

While creating regression tests for EXPLAIN I am (somehow) unable to get
(TIMING) option to work with EXPLAIN!

I must be doing something stupid but all these options below just didn't
work. Could someone point me to the right direction?

mpf2=# explain (TIMING) SELECT 1;
ERROR: EXPLAIN option TIMING requires ANALYZE

mpf2=# EXPLAIN (TIMING FALSE) SELECT 1;
QUERY PLAN
------------------------------------------
Result (cost=0.00..0.01 rows=1 width=0)
(1 row)

mpf2=# EXPLAIN ANALYSE (TIMING) SELECT 1;
ERROR: syntax error at or near "TIMING"
LINE 1: EXPLAIN ANALYSE (TIMING) SELECT 1;
^
mpf2=# EXPLAIN ANALYSE (TIMING TRUE) SELECT 1;
ERROR: syntax error at or near "TIMING"
LINE 1: EXPLAIN ANALYSE (TIMING TRUE) SELECT 1;
^
mpf2=# EXPLAIN ANALYSE TIMING TRUE SELECT 1;
ERROR: syntax error at or near "TIMING"
LINE 1: EXPLAIN ANALYSE TIMING TRUE SELECT 1;
^
mpf2=# EXPLAIN ANALYSE TIMING SELECT 1;
ERROR: syntax error at or near "TIMING"
LINE 1: EXPLAIN ANALYSE TIMING SELECT 1;
^
mpf2=# EXPLAIN TIMING ANALYSE SELECT 1;
ERROR: syntax error at or near "TIMING"
LINE 1: EXPLAIN TIMING ANALYSE SELECT 1;
^
mpf2=# EXPLAIN (TIMING) ANALYSE SELECT 1;
ERROR: syntax error at or near "ANALYSE"
LINE 1: EXPLAIN (TIMING) ANALYSE SELECT 1;
^
mpf2=# EXPLAIN (TIMING) ANALYZE SELECT 1;
ERROR: syntax error at or near "ANALYZE"
LINE 1: EXPLAIN (TIMING) ANALYZE SELECT 1;
^
mpf2=# EXPLAIN (TIMING FALSE) ANALYZE SELECT 1;
ERROR: syntax error at or near "ANALYZE"
LINE 1: EXPLAIN (TIMING FALSE) ANALYZE SELECT 1;
^
mpf2=# SELECT version();
version

--------------------------------------------------------------------------------
------------------------------
PostgreSQL 9.2.3 on x86_64-unknown-linux-gnu, compiled by gcc (GCC) 4.4.6
20120
305 (Red Hat 4.4.6-4), 64-bit
(1 row)

Thanks
--
Robins Tharakan

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andres Freund 2013-04-12 15:18:08 Re: How to use EXPLAIN (TIMING)
Previous Message Robert Haas 2013-04-12 15:13:59 Re: [PATCH] pg_regress and non-default unix socket path