Re: Optimize querry sql

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: "Scott Marlowe" <scott(dot)marlowe(at)gmail(dot)com>
Cc: "A(dot) Kretschmer" <andreas(dot)kretschmer(at)schollglas(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: Optimize querry sql
Date: 2007-09-15 14:25:46
Message-ID: 02B986A3-8CED-4140-AE23-C1928041A822@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Joseph Krogh 2007-09-16 11:00:53 Format intervall as hours/minutes etc
Previous Message Scott Marlowe 2007-09-14 15:17:13 Re: Optimize querry sql