From 8436489c81c23af637696ac69cdaafddcc907ee1 Mon Sep 17 00:00:00 2001
From: Tom Lane <tgl@sss.pgh.pa.us>
Date: Wed, 2 Mar 2011 14:43:24 -0500
Subject: Add KNNGIST support to contrib/btree_gist.

This extends GiST's support for nearest-neighbor searches to many of the
standard data types.

Teodor Sigaev
---
 contrib/btree_gist/sql/int8.sql | 6 ++++++
 1 file changed, 6 insertions(+)

(limited to 'contrib/btree_gist/sql/int8.sql')

diff --git a/contrib/btree_gist/sql/int8.sql b/contrib/btree_gist/sql/int8.sql
index 747bdca1ec9..51e55e9c14b 100644
--- a/contrib/btree_gist/sql/int8.sql
+++ b/contrib/btree_gist/sql/int8.sql
@@ -16,6 +16,8 @@ SELECT count(*) FROM int8tmp WHERE a >= 464571291354841;
 
 SELECT count(*) FROM int8tmp WHERE a >  464571291354841;
 
+SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> '464571291354841' LIMIT 3;
+
 CREATE INDEX int8idx ON int8tmp USING gist ( a );
 
 SET enable_seqscan=off;
@@ -29,3 +31,7 @@ SELECT count(*) FROM int8tmp WHERE a  = 464571291354841::int8;
 SELECT count(*) FROM int8tmp WHERE a >= 464571291354841::int8;
 
 SELECT count(*) FROM int8tmp WHERE a >  464571291354841::int8;
+
+EXPLAIN (COSTS OFF)
+SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> '464571291354841' LIMIT 3;
+SELECT a, a <-> '464571291354841' FROM int8tmp ORDER BY a <-> '464571291354841' LIMIT 3;
-- 
cgit v1.2.3

