Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id E044B9FB429 for ; Tue, 24 Jul 2007 16:31:12 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 77831-07 for ; Tue, 24 Jul 2007 16:31:07 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.5 Received: from fafnir.androme.com (fafnir.androme.com [62.58.96.158]) by postgresql.org (Postfix) with ESMTP id A3E499FB9C5 for ; Tue, 24 Jul 2007 16:31:09 -0300 (ADT) Received: by fafnir.androme.com (Postfix, from userid 1003) id 9E752B993DD; Tue, 24 Jul 2007 21:31:08 +0200 (CEST) Message-ID: <46A6537B.6010604@andromeiberica.com> Date: Tue, 24 Jul 2007 21:31:07 +0200 From: Arnau Reply-To: arnaulist@andromeiberica.com User-Agent: Thunderbird 2.0.0.5 (Windows/20070716) MIME-Version: 1.0 To: Tom Lane CC: PostgreSQL Performance Subject: Re: index over timestamp not being used References: <46A64475.3040201@andromeiberica.com> <14907.1185305095@sss.pgh.pa.us> In-Reply-To: <14907.1185305095@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200707/323 X-Sequence-Number: 26007 Hi Tom, > > Alternatively, do you really need to_timestamp at all? The standard > timestamp input routine won't have any problem with that format: > t.timestamp_in >= '20070101' This is always I think I'm worried, what happens if one day the internal format in which the DB stores the date/timestamps changes. I mean, if instead of being stored as YYYYMMDD is stored as DDMMYYYY, should we have to change all the queries? I thought the to_char/to_date/to_timestamp functions were intented for this purposes -- Arnau