Re: Question on round-robin partitioning

From: Vick Khera <vivek(at)khera(dot)org>
To: Postgres General Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question on round-robin partitioning
Date: 2009-08-31 20:14:46
Message-ID: 2968dfd60908311314u74f7c6f8ta6402fd255eba177@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sat, Aug 29, 2009 at 7:31 AM, Alban
Hertroys<dalroi(at)solfertje(dot)student(dot)utwente(dot)nl> wrote:
> What about foo_id = 100 AND foo_id % 8 = 100 % 8 ?
>

If the optimizer computes 100 % 8 before running the constraint
matching then it would work. I'm not sure it does. foo_id=100 and
foo_id % 8 = 4 will definitely match your constraint.

Depending on how your code makes up the queries, you can bypass
constraint exclusion and reference the sub table directly. This is
how we do it. We have only one query in our entire system that cannot
do this, because we always work on exactly one foo_id at a time except
when doing global statistics which scan every row anyhow. There's
really no point testing 100 constraints for a foo_id=100 type query
since you can do that in your code before hand much more efficiently.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sheng Cheng 2009-08-31 23:02:43 Aggregate function with subquery in 8.3 and 8.4.
Previous Message BlackMage 2009-08-31 19:02:27 Import Using PHPPGADMIN