[BUGS] range query with timestamp returns different result with index than without (7.3.3) -
08-07-2003
, 03:04 AM
--Apple-Mail-3-327498534
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
format=flowed
Hi,
I'm have the following query:
select count(*) from delivery where "creation_date" <= TIMESTAMP
'2003-04-01 00:00:00' and "creation_date" > TIMESTAMP '2003-03-01
00:00:00';
without any index the range query returns the correct result namely
272394, when i create an index on creation_date,
I get 10371 as a result.
I'm using 7.3.3 on Linux (gentoo).
Any help appreciated, if you need more information I'm happy to provide
it.
Here is a transcript:
gaiaperformance=> select count(*) from delivery where "creation_date"
<= TIMESTAMP '2003-04-01 00:00:00' and "creation_date" > TIMESTAMP
'2003-03-01 00:00:00';
count
--------
272394
(1 row)
gaiaperformance=> create index creation_date_ind on delivery
(creation_date);
CREATE INDEX
gaiaperformance=> select count(*) from delivery where "creation_date"
<= TIMESTAMP '2003-04-01 00:00:00' and "creation_date" > TIMESTAMP
'2003-03-01 00:00:00';
count
-------
10371
(1 row)
christian
----------------------------------------------
Christian van der Leeden
Logic United GmbH
Tel: 089-189488-66 Mob: 0163-3747111
www.logicunited.com
--Apple-Mail-3-327498534
Content-Disposition: attachment;
filename="Christian van der Leeden.vcf"
Content-Transfer-Encoding: quoted-printable
Content-Type: text/directory;
x-unix-mode=0644;
name="Christian van der Leeden.vcf"
BEGIN:VCARD=0D
VERSION:3.0=0D
N:van der Leeden;Christian;;;=0D
FN:Christian van der Leeden=0D
ORG:Logic United GmbH;=0D
TITLE:Software Engineering=0D
EMAIL;type=3DHOME;type=3Dpref:leeden (AT) logicunited (DOT) com=0D
EMAIL;type=3DHOME:leeden (AT) samira (DOT) de=0D
TEL;type=3DWORK;type=3Dpref:+49-89-189488-66=0D
TEL;type=3DCELL:+49-163-3747111=0D
ADR;type=3DWORK;type=3Dpref:;;Brecherspitzstrasse 8;Muenchen;;81541;Germany=
=0D
URL:www.logicunited.com=0D
END:VCARD=0D
--Apple-Mail-3-327498534
Content-Type: text/plain
Content-Disposition: inline
Content-Transfer-Encoding: 8bit
MIME-Version: 1.0
---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?
http://www.postgresql.org/docs/faqs/FAQ.html
--Apple-Mail-3-327498534-- |