Обсуждение: How to use EXPLAIN (TIMING)

Поиск
Список
Период
Сортировка

How to use EXPLAIN (TIMING)

От
Robins Tharakan
Дата:
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

Re: How to use EXPLAIN (TIMING)

От
Andres Freund
Дата:
On 2013-04-12 20:44:02 +0530, Robins Tharakan wrote:
> 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?

EXPLAIN (ANALYZE, TIMING on/off) ...;

Greetings,

Andres Freund

-- Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services