Search Postgresql Archives

Re: 8.2.4 serious slowdown

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



2008/1/13, Sim Zacks <sim@xxxxxxxxxxxxxx>:
> 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

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux