"Marshall, Steve" <[EMAIL PROTECTED]> wrote: > the first query would be optimized using > constraint exclusion, while the second query would not: > > SELECT * FROM test_bulletins WHERE created_at > '2006-09-09 > 05:00:00+00'::timestamptz; > SELECT * FROM test_bulletins WHERE created_at > '2006-09-09 > 05:00:00+00'::timestamptz + '0 days'::interval;
Hmmm... CE seems to be still not enough to optimize complex expressions. If I added the wrapper function, it worked. CREATE FUNCTION timeadd(timestamptz, interval) RETURNS timestamptz AS $$ SELECT $1 + $2; $$ LANGUAGE sql IMMUTABLE; SELECT * FROM test_bulletins WHERE created_at > timeadd('2006-09-09 05:00:00+00', '0 days'); I noticed that we should be careful about CE with prepared statements and functions. Seamless partitioning requires more works. Regards, --- ITAGAKI Takahiro NTT Open Source Software Center ---------------------------(end of broadcast)--------------------------- TIP 1: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to [EMAIL PROTECTED] so that your message can get through to the mailing list cleanly