Re: Questions about horizontal partitioning - Mailing list pgsql-general

From Bruno Wolff III
Subject Re: Questions about horizontal partitioning
Date
Msg-id 20070109224601.GC11072@wolff.to
Whole thread Raw
In response to Re: Questions about horizontal partitioning  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Questions about horizontal partitioning  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
On Tue, Jan 09, 2007 at 10:33:52 -0500,
  Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> No, that's still not right.  With a LEFT JOIN you know that each row of
> the narrow table will produce at least one row in the join view.  What
> you don't know is whether the row could produce more than one join row
> --- ie, is there more than one wide-table row that joins to it?

Thanks for pointing that out. I only thought of half of the problem.

> To optimize away the join, the planner would have to find a unique
> constraint on the wide table's join column(s).  This is certainly doable
> in principle, though I find it questionable whether the planner should
> spend cycles on every join query checking for something that won't be
> true in the vast majority of real-world queries.  The main reason we

In this case the test would only be applied when no columns were being used
in a table being joined to. Since that is also an unusual case, if that case
could be quickly checked for, then it might conceivably be worth doing the
more expensive test for the proper not null foreign key relation and unique
constraint.

pgsql-general by date:

Previous
From: Andrew Kroeger
Date:
Subject: Re: ERROR: invalid memory alloc request size, and others
Next
From: Tom Lane
Date:
Subject: Re: Array constructor requires one argument