Re: Optimize querry sql - Mailing list pgsql-sql

From Michael Glaesemann
Subject Re: Optimize querry sql
Date
Msg-id 02B986A3-8CED-4140-AE23-C1928041A822@seespotcode.net
Whole thread Raw
In response to Re: Optimize querry sql  ("Scott Marlowe" <scott.marlowe@gmail.com>)
List pgsql-sql
On Sep 14, 2007, at 10:17 , Scott Marlowe wrote:

> OK, I was just afraid there was some "bad thing" TM that I wasn't
> aware of with now(), which, btw, I use all the time.  whew.

I use CURRENT_TIMESTAMP and CURRENT_DATE for three reasons:
* they're SQL-standard keywords, unlike now(). This might make it  
more portable, but I'm not planning on using another backend any time  
soon.
* I think it's clearer to distinguish between timestamps and dates
* I don't like the look of now() with the parens.

Not that these are necessarily good reasons, but they're mine :). I  
haven't measured it, but there might actually be (a very small bit  
of) overhead in calling CURRENT_TIMESTAMP and CURRENT_DATE as they're  
converted to now(), so that's one potential reason not to use them.

Michael Glaesemann
grzm seespotcode net




pgsql-sql by date:

Previous
From: "Scott Marlowe"
Date:
Subject: Re: Optimize querry sql
Next
From: Andreas Joseph Krogh
Date:
Subject: Format intervall as hours/minutes etc