diff --git a/.travis.yml b/.travis.yml index 758f119..4df87d5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,9 +8,10 @@ env: - PG_SUPPORTED_VERSIONS=13 - PG_SUPPORTED_VERSIONS=14 - PG_SUPPORTED_VERSIONS=15 + - PG_SUPPORTED_VERSIONS=16 language: C -dist: bionic +dist: focal before_install: # extra apt.pg.o.sh options added in version 204, travis currently has 199 (2019-11-27) diff --git a/expected/moc100.out b/expected/moc100.out index dfe0399..51d668b 100644 --- a/expected/moc100.out +++ b/expected/moc100.out @@ -1,3 +1,14 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 10, 11, 12 +(1 row) + + outputfile_for_arch_bits +-------------------------- + 64-bit +(1 row) + CREATE TABLE moc100 ( ivoid text, coverage smoc, diff --git a/expected/moc100_1.out b/expected/moc100_1.out index 648d7c7..c7d6255 100644 --- a/expected/moc100_1.out +++ b/expected/moc100_1.out @@ -1,3 +1,14 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 10, 11, 12 +(1 row) + + outputfile_for_arch_bits +-------------------------- + 32-bit +(1 row) + CREATE TABLE moc100 ( ivoid text, coverage smoc, diff --git a/expected/moc100_2.out b/expected/moc100_2.out index e19ec64..0f511a8 100644 --- a/expected/moc100_2.out +++ b/expected/moc100_2.out @@ -1,3 +1,14 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 13, 14, 15 +(1 row) + + outputfile_for_arch_bits +-------------------------- + 64-bit +(1 row) + CREATE TABLE moc100 ( ivoid text, coverage smoc, diff --git a/expected/moc100_3.out b/expected/moc100_3.out index 2f85349..c650501 100644 --- a/expected/moc100_3.out +++ b/expected/moc100_3.out @@ -1,3 +1,14 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 13, 14, 15 +(1 row) + + outputfile_for_arch_bits +-------------------------- + 32-bit +(1 row) + CREATE TABLE moc100 ( ivoid text, coverage smoc, diff --git a/expected/moc100_4.out b/expected/moc100_4.out new file mode 100644 index 0000000..13e2306 --- /dev/null +++ b/expected/moc100_4.out @@ -0,0 +1,309 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 16+ +(1 row) + + outputfile_for_arch_bits +-------------------------- + 64-bit +(1 row) + +CREATE TABLE moc100 ( + ivoid text, + coverage smoc, + ref_system_name text +); +COPY moc100 FROM STDIN; +CREATE INDEX ON moc100 USING GIN (coverage); +SELECT ivoid FROM moc100 WHERE coverage && '4/0' ORDER BY ivoid; + ivoid +------------------------------------------ + ivo://byu.arvo/dfbsspec/q/getssa + ivo://cadc.nrc.ca/archive/cfht + ivo://cadc.nrc.ca/archive/hst + ivo://cds.vizier/b/assocdata + ivo://cds.vizier/b/swift + ivo://cds.vizier/i/241 + ivo://cds.vizier/iv/12 + ivo://cds.vizier/ix/13 + ivo://cds.vizier/j/a+a/316/147 + ivo://cds.vizier/j/a+as/105/311 + ivo://cds.vizier/j/a+as/122/235 + ivo://chivo/gaia/q/dr1 + ivo://chivo/openngc/q/data + ivo://cxc.harvard.edu/csc + ivo://irsa.ipac/2mass/catalog/psc + ivo://irsa.ipac/2mass/catalog/xsc + ivo://irsa.ipac/2mass/images/asky-ql + ivo://irsa.ipac/cosmos/images + ivo://irsa.ipac/iras/images/issa + ivo://irsa.ipac/mast/scrapbook + ivo://irsa.ipac/spitzer/images/swire + ivo://mssl.ucl.ac.uk/xmmsuss_dsa/xmmsuss + ivo://ned.ipac/sia + ivo://ned.ipac/tap + ivo://svo.cab/cat/gbs + ivo://svo.cab/cat/uves + ivo://svo.cab/cat/xshooter + ivo://vopdc.iap/fss + ivo://vopdc.obspm/imcce/m4ast + ivo://vopdc.obspm/imcce/miriade + ivo://vopdc.obspm/imcce/skybot + ivo://vopdc.obspm/lesia/bestars/besc + ivo://vopdc.obspm/lesia/bestars/bess + ivo://vopdc.obspm/luth/exoplanet + ivo://vopdc.obspm/luth/hess +(35 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '0/'; + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=0.00..4.01 rows=1 width=96) (actual rows=0 loops=1) + Recheck Cond: (coverage && '0/'::smoc) + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..0.00 rows=1 width=0) (actual rows=0 loops=1) + Index Cond: (coverage && '0/'::smoc) + Planning: + Buffers: shared hit=5 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '4/0'; + QUERY PLAN +-------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=35 loops=1) + Filter: (coverage && '4/0'::smoc) + Rows Removed by Filter: 66 + Buffers: shared hit=114 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/0-11'; + QUERY PLAN +-------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=23 loops=1) + Filter: (coverage = '0/0-11'::smoc) + Rows Removed by Filter: 78 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=4 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=1 loops=1) + Filter: (coverage = '6/43225 43227'::smoc) + Rows Removed by Filter: 100 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/'; + QUERY PLAN +------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=1 loops=1) + Filter: (coverage = '0/'::smoc) + Rows Removed by Filter: 100 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/0-11'; + QUERY PLAN +---------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=78 loops=1) + Filter: (coverage <> '0/0-11'::smoc) + Rows Removed by Filter: 23 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=4 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'; + QUERY PLAN +----------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=100 loops=1) + Filter: (coverage <> '6/43225 43227'::smoc) + Rows Removed by Filter: 1 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/'; + QUERY PLAN +----------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=100 loops=1) + Filter: (coverage <> '0/'::smoc) + Rows Removed by Filter: 1 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +SET enable_seqscan = off; +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=38.92..42.93 rows=1 width=96) (actual rows=35 loops=1) + Recheck Cond: (coverage && '4/0'::smoc) + Heap Blocks: exact=5 + Buffers: shared hit=85 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..38.92 rows=1 width=0) (actual rows=35 loops=1) + Index Cond: (coverage && '4/0'::smoc) + Buffers: shared hit=9 + Planning: + Buffers: shared hit=1 +(9 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <@ '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=47.61..51.63 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage <@ '4/0'::smoc) + Rows Removed by Index Recheck: 35 + Heap Blocks: exact=5 + Buffers: shared hit=33 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..47.61 rows=1 width=0) (actual rows=36 loops=1) + Index Cond: (coverage <@ '4/0'::smoc) + Buffers: shared hit=12 + Planning: + Buffers: shared hit=4 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage @> '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=38.92..42.93 rows=1 width=96) (actual rows=28 loops=1) + Recheck Cond: (coverage @> '4/0'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=4 + Buffers: shared hit=36 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..38.92 rows=1 width=0) (actual rows=29 loops=1) + Index Cond: (coverage @> '4/0'::smoc) + Buffers: shared hit=9 + Planning: + Buffers: shared hit=4 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/0-11'; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106879.01..106883.02 rows=1 width=96) (actual rows=23 loops=1) + Recheck Cond: (coverage = '0/0-11'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=2 + Buffers: shared hit=24581 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106879.01 rows=1 width=0) (actual rows=24 loops=1) + Index Cond: (coverage = '0/0-11'::smoc) + Buffers: shared hit=24577 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=12.83..16.84 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage = '6/43225 43227'::smoc) + Rows Removed by Index Recheck: 28 + Heap Blocks: exact=3 + Buffers: shared hit=12 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..12.83 rows=1 width=0) (actual rows=29 loops=1) + Index Cond: (coverage = '6/43225 43227'::smoc) + Buffers: shared hit=3 + Planning: + Buffers: shared hit=1 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/'; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=12.83..16.84 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage = '0/'::smoc) + Heap Blocks: exact=1 + Buffers: shared hit=5 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..12.83 rows=1 width=0) (actual rows=1 loops=1) + Index Cond: (coverage = '0/'::smoc) + Buffers: shared hit=4 + Planning: + Buffers: shared hit=1 +(9 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/0-11'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=78 loops=1) + Recheck Cond: (coverage <> '0/0-11'::smoc) + Rows Removed by Index Recheck: 23 + Heap Blocks: exact=5 + Buffers: shared hit=24821 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '0/0-11'::smoc) + Buffers: shared hit=24762 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=100 loops=1) + Recheck Cond: (coverage <> '6/43225 43227'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=5 + Buffers: shared hit=247 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '6/43225 43227'::smoc) + Buffers: shared hit=188 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=100 loops=1) + Recheck Cond: (coverage <> '0/'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=5 + Buffers: shared hit=245 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '0/'::smoc) + Buffers: shared hit=186 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + diff --git a/expected/moc100_5.out b/expected/moc100_5.out new file mode 100644 index 0000000..3fb98a4 --- /dev/null +++ b/expected/moc100_5.out @@ -0,0 +1,309 @@ +\set ECHO none + outputfile_for_majorversion +----------------------------- + 16+ +(1 row) + + outputfile_for_arch_bits +-------------------------- + 32-bit +(1 row) + +CREATE TABLE moc100 ( + ivoid text, + coverage smoc, + ref_system_name text +); +COPY moc100 FROM STDIN; +CREATE INDEX ON moc100 USING GIN (coverage); +SELECT ivoid FROM moc100 WHERE coverage && '4/0' ORDER BY ivoid; + ivoid +------------------------------------------ + ivo://byu.arvo/dfbsspec/q/getssa + ivo://cadc.nrc.ca/archive/cfht + ivo://cadc.nrc.ca/archive/hst + ivo://cds.vizier/b/assocdata + ivo://cds.vizier/b/swift + ivo://cds.vizier/i/241 + ivo://cds.vizier/iv/12 + ivo://cds.vizier/ix/13 + ivo://cds.vizier/j/a+a/316/147 + ivo://cds.vizier/j/a+as/105/311 + ivo://cds.vizier/j/a+as/122/235 + ivo://chivo/gaia/q/dr1 + ivo://chivo/openngc/q/data + ivo://cxc.harvard.edu/csc + ivo://irsa.ipac/2mass/catalog/psc + ivo://irsa.ipac/2mass/catalog/xsc + ivo://irsa.ipac/2mass/images/asky-ql + ivo://irsa.ipac/cosmos/images + ivo://irsa.ipac/iras/images/issa + ivo://irsa.ipac/mast/scrapbook + ivo://irsa.ipac/spitzer/images/swire + ivo://mssl.ucl.ac.uk/xmmsuss_dsa/xmmsuss + ivo://ned.ipac/sia + ivo://ned.ipac/tap + ivo://svo.cab/cat/gbs + ivo://svo.cab/cat/uves + ivo://svo.cab/cat/xshooter + ivo://vopdc.iap/fss + ivo://vopdc.obspm/imcce/m4ast + ivo://vopdc.obspm/imcce/miriade + ivo://vopdc.obspm/imcce/skybot + ivo://vopdc.obspm/lesia/bestars/besc + ivo://vopdc.obspm/lesia/bestars/bess + ivo://vopdc.obspm/luth/exoplanet + ivo://vopdc.obspm/luth/hess +(35 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '0/'; + QUERY PLAN +---------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=0.00..4.01 rows=1 width=96) (actual rows=0 loops=1) + Recheck Cond: (coverage && '0/'::smoc) + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..0.00 rows=1 width=0) (actual rows=0 loops=1) + Index Cond: (coverage && '0/'::smoc) + Planning: + Buffers: shared hit=5 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '4/0'; + QUERY PLAN +-------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=35 loops=1) + Filter: (coverage && '4/0'::smoc) + Rows Removed by Filter: 66 + Buffers: shared hit=115 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/0-11'; + QUERY PLAN +-------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=23 loops=1) + Filter: (coverage = '0/0-11'::smoc) + Rows Removed by Filter: 78 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=4 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=1 loops=1) + Filter: (coverage = '6/43225 43227'::smoc) + Rows Removed by Filter: 100 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/'; + QUERY PLAN +------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=1 width=96) (actual rows=1 loops=1) + Filter: (coverage = '0/'::smoc) + Rows Removed by Filter: 100 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/0-11'; + QUERY PLAN +---------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=78 loops=1) + Filter: (coverage <> '0/0-11'::smoc) + Rows Removed by Filter: 23 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=4 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'; + QUERY PLAN +----------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=100 loops=1) + Filter: (coverage <> '6/43225 43227'::smoc) + Rows Removed by Filter: 1 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/'; + QUERY PLAN +----------------------------------------------------------------------------------- + Seq Scan on moc100 (cost=0.00..6.26 rows=100 width=96) (actual rows=100 loops=1) + Filter: (coverage <> '0/'::smoc) + Rows Removed by Filter: 1 + Buffers: shared hit=59 + Planning: + Buffers: shared hit=1 +(6 rows) + +SET enable_seqscan = off; +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage && '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=38.92..42.93 rows=1 width=96) (actual rows=35 loops=1) + Recheck Cond: (coverage && '4/0'::smoc) + Heap Blocks: exact=5 + Buffers: shared hit=86 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..38.92 rows=1 width=0) (actual rows=35 loops=1) + Index Cond: (coverage && '4/0'::smoc) + Buffers: shared hit=9 + Planning: + Buffers: shared hit=1 +(9 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <@ '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=47.61..51.63 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage <@ '4/0'::smoc) + Rows Removed by Index Recheck: 35 + Heap Blocks: exact=5 + Buffers: shared hit=33 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..47.61 rows=1 width=0) (actual rows=36 loops=1) + Index Cond: (coverage <@ '4/0'::smoc) + Buffers: shared hit=12 + Planning: + Buffers: shared hit=4 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage @> '4/0'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=38.92..42.93 rows=1 width=96) (actual rows=28 loops=1) + Recheck Cond: (coverage @> '4/0'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=4 + Buffers: shared hit=36 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..38.92 rows=1 width=0) (actual rows=29 loops=1) + Index Cond: (coverage @> '4/0'::smoc) + Buffers: shared hit=9 + Planning: + Buffers: shared hit=4 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/0-11'; + QUERY PLAN +---------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106879.01..106883.02 rows=1 width=96) (actual rows=23 loops=1) + Recheck Cond: (coverage = '0/0-11'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=2 + Buffers: shared hit=24581 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106879.01 rows=1 width=0) (actual rows=24 loops=1) + Index Cond: (coverage = '0/0-11'::smoc) + Buffers: shared hit=24577 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------ + Bitmap Heap Scan on moc100 (cost=12.83..16.84 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage = '6/43225 43227'::smoc) + Rows Removed by Index Recheck: 28 + Heap Blocks: exact=3 + Buffers: shared hit=12 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..12.83 rows=1 width=0) (actual rows=29 loops=1) + Index Cond: (coverage = '6/43225 43227'::smoc) + Buffers: shared hit=3 + Planning: + Buffers: shared hit=1 +(10 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage = '0/'; + QUERY PLAN +----------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=12.83..16.84 rows=1 width=96) (actual rows=1 loops=1) + Recheck Cond: (coverage = '0/'::smoc) + Heap Blocks: exact=1 + Buffers: shared hit=5 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..12.83 rows=1 width=0) (actual rows=1 loops=1) + Index Cond: (coverage = '0/'::smoc) + Buffers: shared hit=4 + Planning: + Buffers: shared hit=1 +(9 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/0-11'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=78 loops=1) + Recheck Cond: (coverage <> '0/0-11'::smoc) + Rows Removed by Index Recheck: 23 + Heap Blocks: exact=5 + Buffers: shared hit=24804 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '0/0-11'::smoc) + Buffers: shared hit=24745 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '6/43225,43227'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=100 loops=1) + Recheck Cond: (coverage <> '6/43225 43227'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=5 + Buffers: shared hit=230 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '6/43225 43227'::smoc) + Buffers: shared hit=171 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + +EXPLAIN (ANALYZE, BUFFERS, TIMING OFF, SUMMARY OFF) + SELECT * FROM moc100 WHERE coverage <> '0/'; + QUERY PLAN +------------------------------------------------------------------------------------------------------------------- + Bitmap Heap Scan on moc100 (cost=106888.23..106894.48 rows=100 width=96) (actual rows=100 loops=1) + Recheck Cond: (coverage <> '0/'::smoc) + Rows Removed by Index Recheck: 1 + Heap Blocks: exact=5 + Buffers: shared hit=228 + -> Bitmap Index Scan on moc100_coverage_idx (cost=0.00..106888.20 rows=100 width=0) (actual rows=101 loops=1) + Index Cond: (coverage <> '0/'::smoc) + Buffers: shared hit=169 + Planning: + Buffers: shared hit=1 + JIT: + Functions: 2 + Options: Inlining false, Optimization false, Expressions true, Deforming true +(13 rows) + diff --git a/sql/moc100.sql b/sql/moc100.sql index 8195f81..8c700b1 100644 --- a/sql/moc100.sql +++ b/sql/moc100.sql @@ -1,3 +1,14 @@ +\set ECHO none +SELECT CASE + WHEN setting::int/10000 IN (10, 11, 12) THEN '10, 11, 12' -- moc100 + WHEN setting::int/10000 IN (13, 14, 15) THEN '13, 14, 15' -- moc100_2 + ELSE '16+' +END AS outputfile_for_majorversion +FROM pg_settings WHERE name = 'server_version_num'; + +SELECT (regexp_matches(version(), '..-bit'))[1] outputfile_for_arch_bits; +\set ECHO queries + CREATE TABLE moc100 ( ivoid text, coverage smoc, diff --git a/src/ellipse.c b/src/ellipse.c index a08f8be..0e535ac 100644 --- a/src/ellipse.c +++ b/src/ellipse.c @@ -426,7 +426,7 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2) } else if (diff[0] <= diff[2] && diff[2] <= diff[1]) { - if (Abs(sp[0].lng - elng) < Abs(sp[2].lng - elng)) + if (fabs(sp[0].lng - elng) < fabs(sp[2].lng - elng)) { memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } @@ -446,7 +446,7 @@ sellipse_ellipse_pos(const SELLIPSE *se1, const SELLIPSE *se2) } else if (diff[2] <= diff[0] && diff[0] <= diff[1]) { - if (Abs(sp[0].lng - elng) < Abs(sp[2].lng - elng)) + if (fabs(sp[0].lng - elng) < fabs(sp[2].lng - elng)) { memcpy((void *) &sp[2], (void *) &sp[1], sizeof(SPoint)); } diff --git a/src/gist.c b/src/gist.c index a142334..b3223a5 100644 --- a/src/gist.c +++ b/src/gist.c @@ -212,7 +212,7 @@ do \ { \ int32 *k = (int32 *) palloc(KEYSIZE); \ if (detoast) \ - genkey(k, (type *) DatumGetPointer(PG_DETOAST_DATUM(entry->key))); \ + genkey(k, (type *) (PG_DETOAST_DATUM(entry->key))); \ else \ genkey(k, (type *) DatumGetPointer(entry->key)); \ gistentryinit(*retval, PointerGetDatum(k), \ @@ -2202,7 +2202,7 @@ do_picksplit(Box3D *boxes, OffsetNumber maxoff, GIST_SPLITVEC *v) for (i = 0; i < commonEntriesCount; i++) { box = &boxes[i]; - commonEntries[i].delta = Abs((unionSizeBox3D(leftBox, box) - leftBoxSize) - + commonEntries[i].delta = fabs((unionSizeBox3D(leftBox, box) - leftBoxSize) - (unionSizeBox3D(rightBox, box) - rightBoxSize)); } diff --git a/src/path.h b/src/path.h index 29c687b..91e1662 100644 --- a/src/path.h +++ b/src/path.h @@ -36,7 +36,7 @@ typedef struct #define PG_GETARG_SPATH(arg) \ - ( (SPATH *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) + ( (SPATH *) (PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) /* * Checks whether two paths are equal. diff --git a/src/polygon.h b/src/polygon.h index 9d47f40..d52a9c6 100644 --- a/src/polygon.h +++ b/src/polygon.h @@ -43,7 +43,7 @@ typedef struct #define PG_GETARG_SPOLY( arg ) \ - ( (SPOLY *) DatumGetPointer(PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) + ( (SPOLY *) (PG_DETOAST_DATUM(PG_GETARG_DATUM(arg))) ) /* * Checks whether two polygons are equal.