Re: Question on round-robin partitioning - Mailing list pgsql-general

From Vick Khera
Subject Re: Question on round-robin partitioning
Date
Msg-id 2968dfd60908311314u74f7c6f8ta6402fd255eba177@mail.gmail.com
Whole thread Raw
In response to Re: Question on round-robin partitioning  (Alban Hertroys <dalroi@solfertje.student.utwente.nl>)
List pgsql-general
On Sat, Aug 29, 2009 at 7:31 AM, Alban
Hertroys<dalroi@solfertje.student.utwente.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.

pgsql-general by date:

Previous
From: BlackMage
Date:
Subject: Import Using PHPPGADMIN
Next
From: Sheng Cheng
Date:
Subject: Aggregate function with subquery in 8.3 and 8.4.