Received: from localhost (unknown [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 447C39F98FF for ; Sat, 15 Sep 2007 11:26:25 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 54517-03 for ; Sat, 15 Sep 2007 11:26:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from proton.planetargon.com (proton.planetargon.com [198.145.115.11]) by postgresql.org (Postfix) with ESMTP id 6CA0B9F987F for ; Sat, 15 Sep 2007 11:26:21 -0300 (ADT) Received: from [192.168.0.133] (75-163-27-220.dlth.qwest.net [75.163.27.220]) by proton.planetargon.com (Postfix) with ESMTP id 263F6898346; Sat, 15 Sep 2007 07:25:54 -0700 (PDT) In-Reply-To: References: <20070914084952.GB7443@a-kretschmer.de> <20070914145202.GA24546@a-kretschmer.de> Mime-Version: 1.0 (Apple Message framework v752.2) Content-Type: text/plain; charset=US-ASCII; delsp=yes; format=flowed Message-Id: <02B986A3-8CED-4140-AE23-C1928041A822@seespotcode.net> Cc: "A. Kretschmer" , pgsql-sql@postgresql.org Content-Transfer-Encoding: 7bit From: Michael Glaesemann Subject: Re: Optimize querry sql Date: Sat, 15 Sep 2007 09:25:46 -0500 To: "Scott Marlowe" X-Mailer: Apple Mail (2.752.2) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/114 X-Sequence-Number: 29327 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