On Sat, Aug 29, 2009 at 7:31 AM, Alban
> 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
pgsql-general by date
|Next:||From: Sheng Cheng||Date: 2009-08-31 23:02:43|
|Subject: Aggregate function with subquery in 8.3 and 8.4.|
|Previous:||From: BlackMage||Date: 2009-08-31 19:02:27|
|Subject: Import Using PHPPGADMIN|