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

Commit4aaa3b5

Browse files
committed
Remove duplicative polygon SP-GiST sequencing test.
Code coverage comparisons confirm that the tests usingquad_poly_tbl_ord_seq1/quad_poly_tbl_ord_idx1 hit no codepaths not also covered by the similar tests usingquad_poly_tbl_ord_seq2/quad_poly_tbl_ord_idx2. Since thesetest cases are pretty expensive, they need to contribute morethan zero benefit.In passing, make quad_poly_tbl_ord_seq2 a temp table, sincethere seems little reason to keep it around after the test.Discussion:https://postgr.es/m/735.1554935715@sss.pgh.pa.us
1 parentd4888a3 commit4aaa3b5

File tree

3 files changed

+2
-48
lines changed

3 files changed

+2
-48
lines changed

‎src/test/regress/expected/polygon.out

Lines changed: 1 addition & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,7 @@ CREATE INDEX quad_poly_tbl_idx ON quad_poly_tbl USING spgist(p);
6666
SET enable_seqscan = ON;
6767
SET enable_indexscan = OFF;
6868
SET enable_bitmapscan = OFF;
69-
CREATE TABLE quad_poly_tbl_ord_seq1 AS
70-
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
71-
FROM quad_poly_tbl;
72-
CREATE TABLE quad_poly_tbl_ord_seq2 AS
69+
CREATE TEMP TABLE quad_poly_tbl_ord_seq2 AS
7370
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
7471
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';
7572
-- check results results from index scan
@@ -283,28 +280,6 @@ SELECT count(*) FROM quad_poly_tbl WHERE p ~= polygon '((200, 300),(210, 310),(2
283280
-- test ORDER BY distance
284281
SET enable_indexscan = ON;
285282
SET enable_bitmapscan = OFF;
286-
EXPLAIN (COSTS OFF)
287-
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
288-
FROM quad_poly_tbl;
289-
QUERY PLAN
290-
-----------------------------------------------------------
291-
WindowAgg
292-
-> Index Scan using quad_poly_tbl_idx on quad_poly_tbl
293-
Order By: (p <-> '(123,456)'::point)
294-
(3 rows)
295-
296-
CREATE TEMP TABLE quad_poly_tbl_ord_idx1 AS
297-
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
298-
FROM quad_poly_tbl;
299-
SELECT *
300-
FROM quad_poly_tbl_ord_seq1 seq FULL JOIN quad_poly_tbl_ord_idx1 idx
301-
ON seq.n = idx.n AND seq.id = idx.id AND
302-
(seq.dist = idx.dist OR seq.dist IS NULL AND idx.dist IS NULL)
303-
WHERE seq.id IS NULL OR idx.id IS NULL;
304-
n | dist | id | n | dist | id
305-
---+------+----+---+------+----
306-
(0 rows)
307-
308283
EXPLAIN (COSTS OFF)
309284
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
310285
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';

‎src/test/regress/expected/sanity_check.out

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -167,8 +167,6 @@ polygon_tbl|t
167167
quad_box_tbl|t
168168
quad_point_tbl|t
169169
quad_poly_tbl|t
170-
quad_poly_tbl_ord_seq1|f
171-
quad_poly_tbl_ord_seq2|f
172170
radix_text_tbl|t
173171
ramp|f
174172
real_city|f

‎src/test/regress/sql/polygon.sql

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ SET enable_seqscan = ON;
6262
SET enable_indexscan= OFF;
6363
SET enable_bitmapscan= OFF;
6464

65-
CREATETABLEquad_poly_tbl_ord_seq1AS
66-
SELECT rank() OVER (ORDER BY p<->point'123,456') n, p<->point'123,456' dist, id
67-
FROM quad_poly_tbl;
68-
69-
CREATETABLEquad_poly_tbl_ord_seq2AS
65+
CREATE TEMP TABLE quad_poly_tbl_ord_seq2AS
7066
SELECT rank() OVER (ORDER BY p<->point'123,456') n, p<->point'123,456' dist, id
7167
FROM quad_poly_tblWHERE p<@polygon'((300,300),(400,600),(600,500),(700,200))';
7268

@@ -127,21 +123,6 @@ SELECT count(*) FROM quad_poly_tbl WHERE p ~= polygon '((200, 300),(210, 310),(2
127123
SET enable_indexscan=ON;
128124
SET enable_bitmapscan= OFF;
129125

130-
EXPLAIN (COSTS OFF)
131-
SELECT rank() OVER (ORDER BY p<->point'123,456') n, p<->point'123,456' dist, id
132-
FROM quad_poly_tbl;
133-
134-
CREATE TEMP TABLE quad_poly_tbl_ord_idx1AS
135-
SELECT rank() OVER (ORDER BY p<->point'123,456') n, p<->point'123,456' dist, id
136-
FROM quad_poly_tbl;
137-
138-
SELECT*
139-
FROM quad_poly_tbl_ord_seq1 seq FULLJOIN quad_poly_tbl_ord_idx1 idx
140-
ONseq.n=idx.nANDseq.id=idx.idAND
141-
(seq.dist=idx.distORseq.dist ISNULLANDidx.dist ISNULL)
142-
WHEREseq.id ISNULLORidx.id ISNULL;
143-
144-
145126
EXPLAIN (COSTS OFF)
146127
SELECT rank() OVER (ORDER BY p<->point'123,456') n, p<->point'123,456' dist, id
147128
FROM quad_poly_tblWHERE p<@polygon'((300,300),(400,600),(600,500),(700,200))';

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp