Re: EXPLAIN ANALYZE

From: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
To: "Neil Conway" <neilc(at)samurai(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN ANALYZE
Date: 2006-12-10 22:46:00
Message-ID: 1165790760.3839.813.camel@silverbirch.site
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, 2006-12-10 at 09:28 -0500, Neil Conway wrote:
> On Sun, 2006-12-10 at 13:00 +0000, Simon Riggs wrote:
> > With that requirement in mind, how about something simple like:
> >
> > explain_analyze_timeout = n
> >
> > When timeout is reached the EA returns results as if it had finished
> > executing normally, though with some additional text to make it very
> > clear that the displayed results are partial execution only.
>
> Sounds like a bit of a kludge, IMHO.

Without a doubt. I was hoping for some further inspiration...

How about any of these?

EXPLAIN [ ANALYZE [TIME LIMIT n]] [ VERBOSE ] statement

EXPLAIN [ ANALYZE [SHOW STATISTICS AFTER n]] [ VERBOSE ] statement

Neither of which need new keywords.

> EXPLAIN ANALYZE isn't designed to
> provide online feedback about the execution of a query, which I think is
> the real feature here. There has been prior discussion about how to do
> online progress indication for queries in general[1] -- I think some
> sort of "online EXPLAIN ANALYZE" would be a natural part of such a
> feature.
>
> -Neil
>
> [1] http://developer.postgresql.org/index.php/Query_progress_indication

Well, that all looks good and can see I'd want all of those things.

The EA case is pretty straightforward though; we don't really need
regular feedback as much as *any* feedback. So, I'm seeing it as a very
simple case of the overall requirement. It's also a special case in that
the output from a partial EA needs to be the same shape as a normal EA.

Query progress data would likely be a different shape, no? You'd need
some estimates of eventual time based upon a re-evaluation of the
original estimates based upon things learned so far during execution.
i.e. at start we thought this loop would be called X times (planner
estimate), so far its been called Y times (EA actual) and based upon
that we now think it will be called Z times. So I'm thinking of
enhancing EA to provide partial results rather than go for the Full
Monty just yet.

BTW, can anybody edit the Wiki? I didn't realise it existed.

--
Simon Riggs
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2006-12-10 23:09:56 Re: EXPLAIN ANALYZE
Previous Message Josh Berkus 2006-12-10 22:39:50 Re: Synchrnonized Scan test