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/time.sql | 6 ++++++
 1 file changed, 6 insertions(+)

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

diff --git a/contrib/btree_gist/sql/time.sql b/contrib/btree_gist/sql/time.sql
index 3329ee64da3..6104e7f61c8 100644
--- a/contrib/btree_gist/sql/time.sql
+++ b/contrib/btree_gist/sql/time.sql
@@ -16,6 +16,8 @@ SELECT count(*) FROM timetmp WHERE a >= '10:57:11';
 
 SELECT count(*) FROM timetmp WHERE a >  '10:57:11';
 
+SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
+
 CREATE INDEX timeidx ON timetmp USING gist ( a );
 
 SET enable_seqscan=off;
@@ -29,3 +31,7 @@ SELECT count(*) FROM timetmp WHERE a  = '10:57:11'::time;
 SELECT count(*) FROM timetmp WHERE a >= '10:57:11'::time;
 
 SELECT count(*) FROM timetmp WHERE a >  '10:57:11'::time;
+
+EXPLAIN (COSTS OFF)
+SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
+SELECT a, a <-> '10:57:11' FROM timetmp ORDER BY a <-> '10:57:11' LIMIT 3;
-- 
cgit v1.2.3

