pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kjell Tore Fossbakk <kjelltore@gmail.com>
To: Michael Glaesemann <grzm@myrealbox.com>
Cc: Tobias Brox <tobias@nordicbet.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Querying 19million records very slowly
Date: Wed, 22 Jun 2005 11:10:42 +0200
Message-ID: <e79986c50506220210578776e@mail.gmail.com> (raw)
In-Reply-To: <8B2836FF-F335-49A4-8131-8EF2D02100F9@myrealbox.com>
References: <e79986c505062112094f579a9b@mail.gmail.com>
	<42B8719A.6040809@refractions.net>
	<op.ssqot4d4th1vuj@localhost>
	<e79986c505062200457fe97695@mail.gmail.com>
	<20050622080357.GW7839@tobias>
	<e79986c5050622011828dd4b41@mail.gmail.com>
	<20050622083921.GZ7839@tobias>
	<8B2836FF-F335-49A4-8131-8EF2D02100F9@myrealbox.com>

> Try to type in '2005-06-21 16:36:22+08' directly in the query, and see if it
> makes changes.  Or probably '2005-06-21 10:36:22+02' in your case ;-)

Which one does Pg read fastes? Does he convert datetime in the table,
then my where clause and check, for each row? How does he compare a
datetime with a datetime? Timestamp are easy, large number bigger than
another large number..

time (datetime) > '2005-06-21 10:36:22+02'

or 

time (timestamp) > 'some timestamp pointing to yesterday'

Hmm.. I cant find any doc that describes this very good.


On 6/22/05, Michael Glaesemann <grzm@myrealbox.com> wrote:
> 
> On Jun 22, 2005, at 5:39 PM, Tobias Brox wrote:
> 
> > (btw, does postgresql really handles timezones?  '+02' is quite  
> > different
> > from 'CET', which will be obvious sometime in the late autoumn...)
> 
> Yes, it does. It doesn't (currently) record the time zone name, but  
> rather only the offset from UTC. If a time zone name (rather than UTC  
> offset) is given, it is converted to the UTC offset *at that  
> timestamptz* when it is stored. For time zones that take into account  
> DST, their UTC offset changes during the year, and PostgreSQL records  
> the equivalent UTC offset for the appropriate timestamptz values.
> 
> There has been discussion in the past on storing the time zone name  
> with the timestamptz as well, though no one has implemented this yet.
> 
> Michael Glaesemann
> grzm myrealbox com
> 
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
> 
>                http://archives.postgresql.org
>



view thread (17+ messages)  latest in thread

Message-ID: <e79986c50506220210578776e@mail.gmail.com>
Permalink:  ../e79986c50506220210578776e@mail.gmail.com/
Also on:    postgresql.org/message-id/e79986c50506220210578776e@mail.gmail.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: kjelltore@gmail.com, grzm@myrealbox.com, tobias@nordicbet.com
  Subject: Re: Querying 19million records very slowly
  In-Reply-To: <e79986c50506220210578776e@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox