The following bug has been logged online: Bug reference: 1252 Logged by: Alexander Kirpa
Email address: [EMAIL PROTECTED] 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 ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match