The following bug has been logged online:
Bug reference: 1252
Logged by: Alexander Kirpa
Email address: postgres(at)bilteks(dot)com
PostgreSQL version: 8.0 Beta
Operating system: FreeBSD 5.2.1
Description: Optimization of SELECT for NOT NULL case
Details:
CREATE TABLE x (id int4 NOT NULL);
Populate table, for instance, 10M rows;
SELECT count(*) from x WHERE x IS NULL;
Optimizator should rewrite "x IS NULL" to simple "false"
Best regards,
Alexander Kirpa