Re: Constraint Exclusion (Partitioning) - Initial Review

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: Constraint Exclusion (Partitioning) - Initial Review
Date: 2005-07-11 16:16:18
Message-ID: 1121098578.3970.88.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Sat, 2005-07-02 at 15:56 -0400, Bruce Momjian wrote:
> > Main questions:
> > 1. How should we handle the case where *all* inherited relations are
> > excluded? (This is not currently covered in the code).
>
> I assume this means we don't return any rows. Why it is an issue?

Not so much an issue as tidy up for a corner case within the code.

I have 3 ways of handling this case:

1. Set the query to scan the first parent relation only (even though we
know we don't have to).

2. Add a flag to RelOptInfo that can be set when this situation occurs,
which would then be used to add a Result(false) top level node at the
end of query_planner in planmain.c

3. Add function return values for a flag to make_one_rel(), just as in
pull_constant_clauses() that would be handled as a a Result(false) top
level node at the end of query_planner in planmain.c. This would require
changes to call parameters of set_base_rel_pathlists() and
set_inherited_rel_pathlist() in allpaths.c

At the moment, this case is not handled in my patch.

(3) is probably structurally the most similar to other existing calls.

I'm not that fussed either way, so will settle towards (3) unless
somebody screams....

Best Regards, Simon Riggs

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Josh Berkus 2005-07-11 16:22:06 Re: Checkpoint cost, looks like it is WAL/CRC
Previous Message David Fetter 2005-07-11 16:15:01 Re: Hide source code

Browse pgsql-patches by date

  From Date Subject
Next Message Marko Kreen 2005-07-11 16:43:33 Re: 4 pgcrypto regressions failures - 1 unsolved
Previous Message Marko Kreen 2005-07-11 15:58:05 Re: 4 pgcrypto regressions failures - 1 unsolved