Commit 5e6ff35d authored by Regina Obe's avatar Regina Obe

more fine tuning to force index use during index tests

git-svn-id: http://svn.osgeo.org/postgis/trunk@13594 b70326c6-7e19-0410-871a-916f4a2858ee
parent d16c2a7a
......@@ -19,12 +19,12 @@ WHERE gid IN(1000, 10000, 2000, 40000);
-- without index order should match st_distance order --
-- point check
SELECT gid, RANK() OVER(ORDER BY ST_Distance( 'POINT(200 1000)'::geometry, geom) )
SELECT gid, ST_Distance( 'POINT(200 1000)'::geometry, geom)::numeric(10,2)
FROM knn_recheck_geom
ORDER BY 'POINT(200 1000)'::geometry <-> geom LIMIT 5;
-- linestring check
SELECT gid, RANK() OVER(ORDER BY ST_Distance( 'LINESTRING(200 100, -10 600)'::geometry, geom) )
SELECT gid, ST_Distance( 'LINESTRING(200 100, -10 600)'::geometry, geom)::numeric(10,2)
FROM knn_recheck_geom
ORDER BY 'LINESTRING(200 100, -10 600)'::geometry <-> geom LIMIT 5;
......@@ -40,8 +40,9 @@ ORDER BY a.gid, b.rn;
-- create index and repeat
CREATE INDEX idx_knn_recheck_geom_gist ON knn_recheck_geom USING gist(geom);
set enable_seqscan = false;
-- point check after index
SELECT gid, RANK() OVER(ORDER BY ST_Distance( 'POINT(200 1000)'::geometry, geom) )
SELECT gid, ST_Distance( 'POINT(200 1000)'::geometry, geom)::numeric(10,2)
FROM knn_recheck_geom
ORDER BY 'POINT(200 1000)'::geometry <-> geom LIMIT 5;
......
500001|1
206360|2
206359|3
206361|4
206358|5
500000|1
134128|2
199066|3
155774|4
112482|5
500001|0.00
206360|122.32
206359|122.42
206361|122.72
206358|123.01
500000|0.00
134128|0.04
199066|0.04
155774|0.04
112482|0.04
50000|48969|1|1
50000|51031|2|2
50000|47938|3|3
......@@ -28,11 +28,11 @@
70000|600004|1|1
70000|71031|4|4
70000|68969|5|5
500001|1
206360|2
206359|3
206361|4
206358|5
500001|0.00
206360|122.32
206359|122.42
206361|122.72
206358|123.01
50000|48969|1|1
50000|51031|2|2
50000|47938|3|3
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment