Re: Constraint Exclusion on all tables

From: "Jim C(dot) Nasby" <decibel(at)decibel(dot)org>
To: Dawid Kuroczko <qnex42(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Constraint Exclusion on all tables
Date: 2005-07-20 20:54:18
Message-ID: 20050720205418.GY10127@decibel.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jul 20, 2005 at 12:52:28PM +0200, Dawid Kuroczko wrote:
> On 7/20/05, Simon Riggs <simon(at)2ndquadrant(dot)com> wrote:
> > > Since it's also possible to do partitioning with UNION ALL, maybe it
> > > would be better if there was an option to explain that told it either to
> > > show or not show info about eliminated partitions. That would seem to
> > > serve the general case better than coding it according to table type.
> > Can you think up the syntax, so we can comment on that proposal?
>
> hmm, maybe something like:
> EXPLAIN [ ANALYZE ] [ VERBOSE ] [ WITH EXCLUDED ]
>
> Where WITH EXCLUDED would mean to show tables eliminated?

One thought I had about that... it might make sense to have different
defaults for EXCLUDED depending on the table you're hitting. For an
inherited table or a UNION ALL you would probably expect some
elimination to happen, but for queries against other tables you would
expect it not to happen (though I'm not certain you could even get
exclusion outside of inherited tables or a union...)

Also, I think it's possible that down the road people might want to just
be shown excluded tables by default depending on some setting (probably
a psql variable I imagine).

Given those two possibilities, I think it would be better to do

EXPLAIN [ ANALYZE ] [ VERBOSE ] [ ( WITH | WITHOUT ) EXCLUDED ]

That way, the without syntax will be valid from the start.

> Also, it would be a good time to suggest some way for making
> EXPLAIN script-friendly. Like return data as a computer program
> convenient table?

I would absolutely love to see this happen.
--
Jim C. Nasby, Database Consultant decibel(at)decibel(dot)org
Give your computer some brain candy! www.distributed.net Team #1828

Windows: "Where do you want to go today?"
Linux: "Where do you want to go tomorrow?"
FreeBSD: "Are you guys coming, or what?"

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2005-07-20 21:47:20 cygwin bulds broken
Previous Message Jim C. Nasby 2005-07-20 20:46:20 Re: Buildfarm issues on specific machines