Re: EXPLAIN omits schema?

From: Heikki Linnakangas <heikki(at)enterprisedb(dot)com>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: Dave Page <dpage(at)postgresql(dot)org>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: EXPLAIN omits schema?
Date: 2007-06-13 13:35:37
Message-ID: 466FF2A9.20205@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Magnus Hagander wrote:
> On Wed, Jun 13, 2007 at 02:02:24PM +0100, Heikki Linnakangas wrote:
>> DB2 has the concept of "explain tables". Explain output is written to
>> tables, which tools query and pretty print the output. I like that idea
>> in principle. PostgreSQL is a relational database, so having the explain
>> output in relations make sense. No need for XML or any other extra
>> libraries, in either the server or client. Having the data in relational
>> format allows you to query them. For example, show me all sequential
>> scans, or all nodes where the estimated number of rows is off by a
>> certain factor.
>
> Assuming you can actually *represent* the whole plan as tables, that would
> of course work fine.

Sure you can. It's just a question of how complex the schema is :).

> But I assume you mean "virtual tables"? So I do
> EXPLAIN whatever, and get back one or more resultssets with the data? Or do
> they write it to *actual* tables in the database?

I'm not sure. DB2 had real tables, but I found that a bit clumsy. It was
nice because your old explain results were accumulated, but it was also
not nice because of that same thing.

One idea would be temporary tables.

> Machine-readable is of course the main point - the exact format is more of
> an implementation detail.

Agreed.

A potential problem is that as we add new node types etc., we need to
extend the schema (whether it's a real relational schema or XML), and
clients need to understand it. But I guess we already have the same
problem with clients that parse the current explain output.

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2007-06-13 13:36:46 Re: comparing index columns
Previous Message Magnus Hagander 2007-06-13 13:19:17 Re: EXPLAIN omits schema?