Skip site navigation (1) Skip section navigation (2)

Re: Major upgrade advice

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan-Ivar Mellingen <jan-ivar(dot)mellingen(at)alreg(dot)no>
Cc: Roberto Garcia <roberto(dot)garcia(at)cptec(dot)inpe(dot)br>, pgsql-admin(at)postgresql(dot)org
Subject: Re: Major upgrade advice
Date: 2008-06-20 14:24:09
Message-ID: 16600.1213971849@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Jan-Ivar Mellingen <jan-ivar(dot)mellingen(at)alreg(dot)no> writes:
> I got curious and did a few tests on a 8.3.3 database on my laptop.
> The 3 different queries all worked, but one took twice as long.

> SELECT * FROM alarmlogg WHERE alarm_tid >= CAST('2007-05-20' as 
> timestamp) AND alarm_tid < CAST('2008-05-21' as timestamp);
> --> 301 seconds.

Unsurprising: a comparison between a timestamp with timezone and
one without involves a timezone conversion, so it's gonna be slow.

It's a bit annoying that the system doesn't have the intelligence
to convert the constants to timestamptz just once; but I think
doing that would require introducing an implicit cast from
timestamp to timestamptz, which might cause surprising behaviors
elsewhere.

			regards, tom lane

In response to

pgsql-admin by date

Next:From: GeoffreyDate: 2008-06-20 15:56:45
Subject: Re: where would I find the files I need?
Previous:From: Kevin GrittnerDate: 2008-06-20 14:06:19
Subject: Re: Warm-standby in 8.2

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group