Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit7d8e477

Browse files
committed
Slightly improved tests
1 parentfc75d07 commit7d8e477

File tree

3 files changed

+19
-7
lines changed

3 files changed

+19
-7
lines changed

‎expected/index_9.5.out

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ SET enable_seqscan = OFF;
33
SET enable_bitmapscan = OFF;
44
SET enable_indexonlyscan = ON;
55
EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),0.3>';
6-
QUERY PLAN
7-
-------------------------------------------------------
6+
QUERY PLAN
7+
--------------------------------------------------------
88
Aggregate
9-
-> Index Scan using spoint3_idx on spheretmp1b
9+
-> IndexOnlyScan using spoint3_idx on spheretmp1b
1010
Index Cond: (p <@ '<(1 , 1) , 0.3>'::scircle)
1111
(3 rows)
1212

@@ -17,10 +17,10 @@ EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p <@ scircle '<(1,1),
1717
(1 row)
1818

1919
EXPLAIN (COSTS OFF) SELECT count(*) FROM spheretmp1b WHERE p = spoint '(3.09 , 1.25)';
20-
QUERY PLAN
21-
---------------------------------------------------
20+
QUERY PLAN
21+
--------------------------------------------------------
2222
Aggregate
23-
-> Index Scan using spoint3_idx on spheretmp1b
23+
-> IndexOnlyScan using spoint3_idx on spheretmp1b
2424
Index Cond: (p = '(3.09 , 1.25)'::spoint)
2525
(3 rows)
2626

‎expected/knn.out

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,22 @@ EXPLAIN (costs off) SELECT p <-> spoint (0.2, 0.3) FROM points ORDER BY 1 LIMIT
66
QUERY PLAN
77
-------------------------------------------------
88
Limit
9-
-> Index Scan using i on points
9+
-> IndexOnlyScan using i on points
1010
Order By: (p <-> '(0.2 , 0.3)'::spoint)
1111
(3 rows)
1212

1313
UPDATE points SET pos = n FROM (SELECT id, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 10) sel WHERE points.id = sel.id;
1414
SET enable_indexscan = false;
15+
SET enable_indexonlyscan = false;
16+
EXPLAIN (costs off) SELECT p <-> spoint (0.2, 0.3) FROM points ORDER BY 1 LIMIT 10;
17+
QUERY PLAN
18+
---------------------------------------------------
19+
Limit
20+
-> Sort
21+
Sort Key: ((p <-> '(0.2 , 0.3)'::spoint))
22+
-> Seq Scan on points
23+
(4 rows)
24+
1525
SELECT pos, row_number() OVER (ORDER BY p <-> spoint (0.2, 0.3)) n FROM points ORDER BY p <-> spoint (0.2, 0.3) LIMIT 10;
1626
pos | n
1727
-----+----

‎sql/knn.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@ SET enable_indexscan = true;
55
EXPLAIN (costs off)SELECT p<-> spoint (0.2,0.3)FROM pointsORDER BY1LIMIT10;
66
UPDATE pointsSET pos= nFROM (SELECT id, row_number() OVER (ORDER BY p<-> spoint (0.2,0.3)) nFROM pointsORDER BY p<-> spoint (0.2,0.3)LIMIT10) selWHEREpoints.id=sel.id;
77
SET enable_indexscan= false;
8+
SET enable_indexonlyscan= false;
9+
EXPLAIN (costs off)SELECT p<-> spoint (0.2,0.3)FROM pointsORDER BY1LIMIT10;
810
SELECT pos, row_number() OVER (ORDER BY p<-> spoint (0.2,0.3)) nFROM pointsORDER BY p<-> spoint (0.2,0.3)LIMIT10;
911
DROPTABLE points;
1012

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp