Re: BUG #1252: Optimization of SELECT for NOT NULL case

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Alexander Kirpa <postgres(at)bilteks(dot)com>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1252: Optimization of SELECT for NOT NULL case
Date: 2004-09-15 17:21:54
Message-ID: 20040915172154.GA28610@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Jacek Rembisz 2004-09-15 17:49:47 Re: character and text comparison
Previous Message Tom Lane 2004-09-15 16:43:11 Re: character and text comparison