Re: Should the optimiser convert a CASE into a WHERE if it can?

From: Matthew Wakeling <matthew(at)flymine(dot)org>
To: Віталій Тимчишин <tivv00(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Should the optimiser convert a CASE into a WHERE if it can?
Date: 2010-01-27 17:01:30
Message-ID: alpine.DEB.2.00.1001271659000.6195@aragorn.flymine.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Wed, 27 Jan 2010, Віталій Тимчишин wrote:
> How about SELECT SUM (case when id > 1200000 and id < 1210000 then 1 end)
> from tbl_tracker;

That is very interesting.

> * All the functions should be noop for null input

Alas, not true for COUNT(*), AVG(), etc.

Matthew

--
An optimist sees the glass as half full, a pessimist as half empty,
and an engineer as having redundant storage capacity.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Віталій Тимчишин 2010-01-27 17:09:59 Re: Should the optimiser convert a CASE into a WHERE if it can?
Previous Message Віталій Тимчишин 2010-01-27 16:53:46 Re: Should the optimiser convert a CASE into a WHERE if it can?