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

BUG #6399: knngist sometimes returns tuples in incorrect order

From: yamt(at)mwd(dot)biglobe(dot)ne(dot)jp
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #6399: knngist sometimes returns tuples in incorrect order
Date: 2012-01-16 09:32:24
Message-ID: E1RmivQ-0001Mv-VJ@wrigleys.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged on the website:

Bug reference:      6399
Logged by:          YAMAMOTO Takashi
Email address:      yamt(at)mwd(dot)biglobe(dot)ne(dot)jp
PostgreSQL version: Unsupported/Unknown
Operating system:   NetBSD
Description:        

9.2devel
(01d83ffdcae92f75dbfd41de0b4213d241edd394)

knngist seems to assume that any distances can be represented with float8.
at least distances between int8 values can not.

the following example uses btree_gist extension.
results should be the same regardless of the existance of the index.

create temp table t (a int8);
insert into t values (9223372036854775806),(9223372036854775807);
select *,0<->a as dist from t order by dist;
create index on t using gist (a);
set enable_seqscan=off;
select *,0<->a as dist from t order by dist;


CREATE TABLE
INSERT 0 2
          a          |        dist         
---------------------+---------------------
 9223372036854775806 | 9223372036854775806
 9223372036854775807 | 9223372036854775807
(2 rows)

CREATE INDEX
SET
          a          |        dist         
---------------------+---------------------
 9223372036854775807 | 9223372036854775807
 9223372036854775806 | 9223372036854775806
(2 rows)



Responses

pgsql-bugs by date

Next:From: Robert HaasDate: 2012-01-17 01:37:52
Subject: Re: Incorrect comment in heapam.c
Previous:From: Noah MischDate: 2012-01-15 00:27:34
Subject: Re: Re: BUG #6264: Superuser does not have inherentReplication permission

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