range query with timestamp returns different result with index than without (7.3.3)

From: Christian van der Leeden <leeden(at)logicunited(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: range query with timestamp returns different result with index than without (7.3.3)
Date: 2003-08-07 06:51:17
Message-ID: 8B31428A-C8A3-11D7-8031-003065B2CB9C@logicunited.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

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

Attachment Content-Type Size
Christian van der Leeden.vcf text/directory 404 bytes

Browse pgsql-bugs by date

  From Date Subject
Next Message Christian van der Leeden 2003-08-07 06:52:12 range query with timestamp returns different result with index than without (7.3.3)
Previous Message Tom Lane 2003-08-06 22:02:52 Re: pgtcl large object fix