![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
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" |
#3
| |||
| |||
|
|
On Tue, Sep 14, 2004 at 00:57:07 +0100, CREATE TABLE x (id int4 NOT NULL); SELECT count(*) from x WHERE x IS NULL; Optimizator should rewrite "x IS NULL" to simple "false" Based on responses to other optimization requests I have seen, I think the answer to this one is going to be that it isn't worth paying the cost for every query to check for this case, since no one is going to write a query like this except by mistake. |
#4
| |||
| |||
|
|
On Tue, Sep 14, 2004 at 00:57:07 +0100, PostgreSQL Bugs List <pgsql-bugs (AT) postgresql (DOT) org> wrote: 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" Based on responses to other optimization requests I have seen, I think the answer to this one is going to be that it isn't worth paying the cost for every query to check for this case, since no one is going to write a query like this except by mistake. |
#5
| |||
| |||
|
|
On 15 Sep 2004, at 12:21, Bruno Wolff III wrote: Regarding your point of view possible exist reason for remove optimization for case like below SELECT count(*) from x where id>1 AND id<0 I basically don't see any significant difference in optimization for "id IS NULL" and "id>1 AND id<0" |
![]() |
| Thread Tools | |
| Display Modes | |
| |