Re: Hide 'Execution time' in EXPLAIN (COSTS OFF) - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Hide 'Execution time' in EXPLAIN (COSTS OFF)
Date
Msg-id 20140603191318.GV24145@awork2.anarazel.de
Whole thread Raw
In response to Re: Hide 'Execution time' in EXPLAIN (COSTS OFF)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2014-06-03 15:08:15 -0400, Tom Lane wrote:
> Andres Freund <andres@2ndquadrant.com> writes:
> > In 9.4. COSTS OFF for EXPLAIN prevents 'Planning time' to be
> > printed. Should we perhaps do the same for 'Execution time'? That'd make
> > it possible to use EXPLAIN (ANALYZE, COSTS OFF, TIMING OFF) in
> > regression tests.
> 
> > Currently the output for that is:
> > postgres=# EXPLAIN (ANALYZE, TIMING OFF, COSTS OFF) SELECT 1;
> >            QUERY PLAN
> > --------------------------------
> >  Result (actual rows=1 loops=1)
> >  Total runtime: 0.035 ms
> > (2 rows)
> 
> > Leaving off the total runtime doesn't seem bad to me.
> 
> It seems a little weird to call it a "cost" ... but maybe that
> ship has sailed given how we're treating the planning-time item.

It's not what I'd have choosen when starting afresh, but as you say...

> I'm unconvinced that this'd add much to our regression testing capability,
> though.  The standard thing is to do an EXPLAIN to check the plan shape
> and then run the query to see if it gets the right answer.  Checking row
> counts is pretty well subsumed by the latter, and is certainly not an
> adequate substitute for it.

The specific case I wanted it for was to test that a CREATE INDEX in a
specific situation actually has indexed a recently dead row. That can be
made visible via bitmap index scans... Generally index vs heap cases
aren't that easy to check with just the toplevel result.

Greetings,

Andres Freund

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



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Hide 'Execution time' in EXPLAIN (COSTS OFF)
Next
From: Robert Haas
Date:
Subject: Re: Hide 'Execution time' in EXPLAIN (COSTS OFF)