git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: d4888a3)
Remove duplicative polygon SP-GiST sequencing test.
2019年4月11日 18:35:47 +0000 (14:35 -0400)
2019年4月11日 18:35:47 +0000 (14:35 -0400)
Code coverage comparisons confirm that the tests using
quad_poly_tbl_ord_seq1/quad_poly_tbl_ord_idx1 hit no code
paths not also covered by the similar tests using
quad_poly_tbl_ord_seq2/quad_poly_tbl_ord_idx2. Since these
test cases are pretty expensive, they need to contribute more
than zero benefit.

In passing, make quad_poly_tbl_ord_seq2 a temp table, since
there seems little reason to keep it around after the test.

Discussion: https://postgr.es/m/735.1554935715@sss.pgh.pa.us


diff --git a/src/test/regress/expected/polygon.out b/src/test/regress/expected/polygon.out
index 91e2647c4698d7781fd1c6fdd55c5d27c027c403..f319239b2e4cfa1601d0ef12b09ed5bfead0459e 100644 (file)
--- a/src/test/regress/expected/polygon.out
+++ b/src/test/regress/expected/polygon.out
@@ -66,10 +66,7 @@ CREATE INDEX quad_poly_tbl_idx ON quad_poly_tbl USING spgist(p);
SET enable_seqscan = ON;
SET enable_indexscan = OFF;
SET enable_bitmapscan = OFF;
-CREATE TABLE quad_poly_tbl_ord_seq1 AS
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
-CREATE TABLE quad_poly_tbl_ord_seq2 AS
+CREATE TEMP TABLE quad_poly_tbl_ord_seq2 AS
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';
-- check results results from index scan
@@ -283,28 +280,6 @@ SELECT count(*) FROM quad_poly_tbl WHERE p ~= polygon '((200, 300),(210, 310),(2
-- test ORDER BY distance
SET enable_indexscan = ON;
SET enable_bitmapscan = OFF;
-EXPLAIN (COSTS OFF)
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
- QUERY PLAN
------------------------------------------------------------
- WindowAgg
- -> Index Scan using quad_poly_tbl_idx on quad_poly_tbl
- Order By: (p <-> '(123,456)'::point)
-(3 rows)
-
-CREATE TEMP TABLE quad_poly_tbl_ord_idx1 AS
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
-SELECT *
-FROM quad_poly_tbl_ord_seq1 seq FULL JOIN quad_poly_tbl_ord_idx1 idx
- ON seq.n = idx.n AND seq.id = idx.id AND
- (seq.dist = idx.dist OR seq.dist IS NULL AND idx.dist IS NULL)
-WHERE seq.id IS NULL OR idx.id IS NULL;
- n | dist | id | n | dist | id
----+------+----+---+------+----
-(0 rows)
-
EXPLAIN (COSTS OFF)
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';
diff --git a/src/test/regress/expected/sanity_check.out b/src/test/regress/expected/sanity_check.out
index 29682e38668b67f4977f518c387a1f0473ad6ef3..3afe39d2d9951282326487c978742abde425fd5e 100644 (file)
--- a/src/test/regress/expected/sanity_check.out
+++ b/src/test/regress/expected/sanity_check.out
@@ -167,8 +167,6 @@ polygon_tbl|t
quad_box_tbl|t
quad_point_tbl|t
quad_poly_tbl|t
-quad_poly_tbl_ord_seq1|f
-quad_poly_tbl_ord_seq2|f
radix_text_tbl|t
ramp|f
real_city|f
diff --git a/src/test/regress/sql/polygon.sql b/src/test/regress/sql/polygon.sql
index d3a6625cb7cb1757d3722b633cd23771585d1de1..866e11b9e335e1afd827327cbe6cf06a0cefa6ac 100644 (file)
--- a/src/test/regress/sql/polygon.sql
+++ b/src/test/regress/sql/polygon.sql
@@ -62,11 +62,7 @@ SET enable_seqscan = ON;
SET enable_indexscan = OFF;
SET enable_bitmapscan = OFF;
-CREATE TABLE quad_poly_tbl_ord_seq1 AS
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
-
-CREATE TABLE quad_poly_tbl_ord_seq2 AS
+CREATE TEMP TABLE quad_poly_tbl_ord_seq2 AS
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';
@@ -127,21 +123,6 @@ SELECT count(*) FROM quad_poly_tbl WHERE p ~= polygon '((200, 300),(210, 310),(2
SET enable_indexscan = ON;
SET enable_bitmapscan = OFF;
-EXPLAIN (COSTS OFF)
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
-
-CREATE TEMP TABLE quad_poly_tbl_ord_idx1 AS
-SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
-FROM quad_poly_tbl;
-
-SELECT *
-FROM quad_poly_tbl_ord_seq1 seq FULL JOIN quad_poly_tbl_ord_idx1 idx
- ON seq.n = idx.n AND seq.id = idx.id AND
- (seq.dist = idx.dist OR seq.dist IS NULL AND idx.dist IS NULL)
-WHERE seq.id IS NULL OR idx.id IS NULL;
-
-
EXPLAIN (COSTS OFF)
SELECT rank() OVER (ORDER BY p <-> point '123,456') n, p <-> point '123,456' dist, id
FROM quad_poly_tbl WHERE p <@ polygon '((300,300),(400,600),(600,500),(700,200))';
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /