diff options
author | Tom Lane | 2019-04-11 18:35:47 +0000 |
---|---|---|
committer | Tom Lane | 2019-04-11 18:35:47 +0000 |
commit | 4aaa3b5cf1c33d713b8eefa3612a9112cbcf1074 (patch) | |
tree | ed9c9fe280d38f2809d14e70e71bd9a95375f471 | |
parent | d4888a3f766a7c02a9330c658c76c60e1ab8cc3e (diff) |
Remove duplicative polygon SP-GiST sequencing test.
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/[email protected]
-rw-r--r-- | src/test/regress/expected/polygon.out | 27 | ||||
-rw-r--r-- | src/test/regress/expected/sanity_check.out | 2 | ||||
-rw-r--r-- | src/test/regress/sql/polygon.sql | 21 |
3 files changed, 2 insertions, 48 deletions
diff --git a/src/test/regress/expected/polygon.out b/src/test/regress/expected/polygon.out index 91e2647c46..f319239b2e 100644 --- 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 @@ -285,28 +282,6 @@ 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))'; QUERY PLAN --------------------------------------------------------------------------------- diff --git a/src/test/regress/expected/sanity_check.out b/src/test/regress/expected/sanity_check.out index 29682e3866..3afe39d2d9 100644 --- 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 d3a6625cb7..866e11b9e3 100644 --- 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))'; @@ -129,21 +125,6 @@ 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))'; CREATE TEMP TABLE quad_poly_tbl_ord_idx2 AS |