Received: from mel-rto4.wanadoo.fr (smtp-out-4.wanadoo.fr [193.252.19.23]) by postgresql.org (Postfix) with ESMTP id C8B39475852 for ; Wed, 10 Apr 2002 10:53:41 -0400 (EDT) Received: from mel-rta8.wanadoo.fr (193.252.19.79) by mel-rto4.wanadoo.fr; 10 Apr 2002 16:53:46 +0200 Received: from ez (217.128.2.234) by mel-rta8.wanadoo.fr; 10 Apr 2002 16:53:20 +0200 Date: Wed, 10 Apr 2002 10:44:25 -0400 From: Jean-Christophe ARNU (JX) To: dan@langille.org Cc: pgsql-admin@postgresql.org Subject: Re: Timestamps and performances problems Message-Id: <20020410104425.59ce6791.jc.arnu@free.fr> In-Reply-To: <20020410132758.F37F23F30@bast.unixathome.org> References: <20020410130743.C869D3F30@bast.unixathome.org> <20020410132758.F37F23F30@bast.unixathome.org> Organization: IUX X-Mailer: Sylpheed version 0.7.3 (GTK+ 1.2.10; i686-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Archive-Number: 200204/82 X-Sequence-Number: 3970 Le Wed, 10 Apr 2002 09:27:09 -0400 "Dan Langille" me disait que : > On 10 Apr 2002 at 9:13, JX wrote: > > > Le Wed, 10 Apr 2002 09:06:55 -0400 > > "Dan Langille" me disait que : > > > > > On 10 Apr 2002 at 11:51, Gaetano Mendola wrote: > > > > > > > "Jean-Christophe ARNU (JX)" wrote: > > > > > Hello all. > > > > > I've a performance problem on specific requests : > > > > > > > > > > When I use timestamps + interval in where clauses, query > > > > > performance is slowed down by a factor of 20 or 30!!!! For exemple > > > > > : select timestamp,value > > > > > from measure > > > > > where timestamp(now() - '1 hour'::interval) > > > > > > Try where timestamp(now() - '1 > > > hour'::interval)::timestemp. > > > > What's the difference with the syntax above? It takes he same time > > than the query above. Bounded timestamps with "real" ISO timestamps > > strings are always up to about 200 times faster (with extensive test > > proof). > > It casts the value to a timestamp. I would prefer to discuss this on- > list. Okaye, but what's the incidence on preformance issues? Casting should only insure that given string is to be taken as a timestamp isn't it? Does it make an "instanciation" of the timestamp to be that would be applied for comparision clauses? Thanks -- Jean-Christophe ARNU s/w developer Paratronic France «Dès que je clique sur "mount", il ne fait rien et le cdrom reste "unmount". Quel est le pb ?» -+- Popol in Guide du linuxien pervers : "De l'avantage des interfaces..." -+-