From: | Clodoaldo <clodoaldo(dot)pinto(dot)neto(at)gmail(dot)com> |
---|---|
To: | "Sim Zacks" <sim(at)compulab(dot)co(dot)il> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: 8.2.4 serious slowdown |
Date: | 2008-01-13 08:50:48 |
Message-ID: | a595de7a0801130050ye92d410xac788e29a7e40682@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general pgsql-hackers |
2008/1/13, Sim Zacks <sim(at)compulab(dot)co(dot)il>:
> How would you rewrite something like:
> WHERE (COALESCE(b.quantity, 0) - COALESCE(b.deliveredsum, 0)) > 0;
> I could write:
> where case when b.quantity is null then 0 else b.quantity end - case when b.deliveredsum is null then 0 else b.deliveredsum end > 0
>
> It is butt ugly, but is that the most efficient way to write it in 8.2.4?
I don't know if the plan would be the same but this is a bit clearer:
WHERE COALESCE(b.quantity, 0) > COALESCE(b.deliveredsum, 0)
Regards, Clodoaldo Pinto Neto
From | Date | Subject | |
---|---|---|---|
Next Message | Sim Zacks | 2008-01-13 08:58:01 | Re: 8.2.4 serious slowdown |
Previous Message | henry | 2008-01-13 06:40:34 | Re: tcp_keepalives_idle ignored |
From | Date | Subject | |
---|---|---|---|
Next Message | Sim Zacks | 2008-01-13 08:58:01 | Re: 8.2.4 serious slowdown |
Previous Message | Warren Turkal | 2008-01-13 08:22:37 | Re: timestamp refactor effort |