dbTalk Databases Forums  

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

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] range query with timestamp returns different result with index than without (7.3.3) in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Christian van der Leeden
 
Posts: n/a

Default [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--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.