Re: Constraint Exclusion on all tables - Mailing list pgsql-hackers

From Jim C. Nasby
Subject Re: Constraint Exclusion on all tables
Date
Msg-id 20050720205418.GY10127@decibel.org
Whole thread Raw
In response to Re: Constraint Exclusion on all tables  (Dawid Kuroczko <qnex42@gmail.com>)
Responses Re: Constraint Exclusion on all tables  (Josh Berkus <josh@agliodbs.com>)
List pgsql-hackers
On Wed, Jul 20, 2005 at 12:52:28PM +0200, Dawid Kuroczko wrote:
> On 7/20/05, Simon Riggs <simon@2ndquadrant.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@decibel.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?"


pgsql-hackers by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Buildfarm issues on specific machines
Next
From: Andrew Dunstan
Date:
Subject: cygwin bulds broken