[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-559-g6cc58c2a2
git at osgeo.org
git at osgeo.org
Mon Jan 23 11:04:22 PST 2023
This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".
The branch, master has been updated
via 6cc58c2a2608001c395cc84f10a0e0923453d986 (commit)
via 31bcb7d414c73df8dbc2975c6dd4a269b190c874 (commit)
via 3b45fd06046659dab61e00780eb8f46a28b22d7e (commit)
from c5766f2f7069f94b9f4b32ab3243a928d583b21b (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 6cc58c2a2608001c395cc84f10a0e0923453d986
Author: Sandro Santilli <strk at kbt.io>
Date: Mon Jan 23 20:02:35 2023 +0100
Add updated comments for new join/restrict selectivity
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index d5f4bb68f..1ba84b72b 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -683,18 +683,24 @@ CREATE OR REPLACE FUNCTION geometry_within(geom1 geometry, geom2 geometry)
_COST_DEFAULT;
-- Availability: 0.1.0
+-- Updated: 3.4.0 changed to use selectivity estimates
CREATE OPERATOR @ (
LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_within,
COMMUTATOR = '~',
+ -- Updated: 3.4.0 to use selectivity estimator
RESTRICT = gserialized_gist_sel_2d,
+ -- Updated: 3.4.0 to use join selectivity estimator
JOIN = gserialized_gist_joinsel_2d
);
-- Availability: 0.1.0
+-- Updated: 3.4.0 changed to use selectivity estimates
CREATE OPERATOR ~ (
LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_contains,
COMMUTATOR = '@',
+ -- Updated: 3.4.0 to use specialized selectivity estimator
RESTRICT = gserialized_gist_sel_2d,
+ -- Updated: 3.4.0 to use join specialized selectivity estimator
JOIN = gserialized_gist_joinsel_2d
);
commit 31bcb7d414c73df8dbc2975c6dd4a269b190c874
Author: Paul Ramsey <pramsey at cleverelephant.ca>
Date: Tue Dec 13 16:19:35 2022 -0800
Add selectivity estimates to contains/within operators
diff --git a/postgis/postgis.sql.in b/postgis/postgis.sql.in
index 089863493..d5f4bb68f 100644
--- a/postgis/postgis.sql.in
+++ b/postgis/postgis.sql.in
@@ -686,14 +686,16 @@ CREATE OR REPLACE FUNCTION geometry_within(geom1 geometry, geom2 geometry)
CREATE OPERATOR @ (
LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_within,
COMMUTATOR = '~',
- RESTRICT = contsel, JOIN = contjoinsel
+ RESTRICT = gserialized_gist_sel_2d,
+ JOIN = gserialized_gist_joinsel_2d
);
-- Availability: 0.1.0
CREATE OPERATOR ~ (
LEFTARG = geometry, RIGHTARG = geometry, PROCEDURE = geometry_contains,
COMMUTATOR = '@',
- RESTRICT = contsel, JOIN = contjoinsel
+ RESTRICT = gserialized_gist_sel_2d,
+ JOIN = gserialized_gist_joinsel_2d
);
-- Availability: 2.0.0
diff --git a/regress/core/regress_selectivity_expected b/regress/core/regress_selectivity_expected
index 266fa094b..6a0d37514 100644
--- a/regress/core/regress_selectivity_expected
+++ b/regress/core/regress_selectivity_expected
@@ -1,8 +1,8 @@
restrict|geography && geography|gserialized_gist_sel_nd
restrict|geometry && geometry|gserialized_gist_sel_2d
restrict|geometry &&& geometry|gserialized_gist_sel_nd
-restrict|geometry @ geometry|contsel
-restrict|geometry ~ geometry|contsel
+restrict|geometry @ geometry|gserialized_gist_sel_2d
+restrict|geometry ~ geometry|gserialized_gist_sel_2d
ERROR: stats for "no_stats.g" do not exist
ERROR: stats for "no_stats.g" do not exist
ERROR: stats for "no_stats.g" do not exist
commit 3b45fd06046659dab61e00780eb8f46a28b22d7e
Author: Sandro Santilli <strk at kbt.io>
Date: Mon Jan 23 20:01:41 2023 +0100
Add support for Changed/Updated comment in operator attributes
diff --git a/utils/create_upgrade.pl b/utils/create_upgrade.pl
index f941146f9..5d5cc6e88 100755
--- a/utils/create_upgrade.pl
+++ b/utils/create_upgrade.pl
@@ -360,11 +360,30 @@ EOF
my $opleft = 'unknown';
my $opright = 'unknown';
my $def = $_;
+ my $subcomment = '';
+ my @subobjects; # minversion, attribute, value
while(<INPUT>)
{
+ if (/^\s*\-\-/)
+ {
+ $subcomment .= $_;
+ next;
+ }
+
$def .= $_;
$opleft = $1 if (/leftarg\s*=\s*(\w+)\s*,/i);
$opright = $1 if (/rightarg\s*=\s*(\w+)\s*,/i);
+
+ # Support changing restrict selectivity at later versions
+ if (/\s+(RESTRICT|JOIN)\s*=\s*([^,\n]+)/)
+ {
+ my $last_updated = parse_last_updated($subcomment);
+ if ($last_updated)
+ {
+ push @subobjects, [$last_updated, $1, $2];
+ }
+ }
+
last if /\);/;
}
my $opsig = $opleft . " " . $opname . " " . $opright;
@@ -379,8 +398,6 @@ EOF
DO LANGUAGE 'plpgsql'
\$postgis_proc_upgrade\$
BEGIN
- --IF $last_updated > version_from_num FROM _postgis_upgrade_info()
- --We trust presence of operator rather than version info
IF NOT EXISTS (
SELECT o.oprname
FROM
@@ -396,11 +413,31 @@ BEGIN
tr.typname = '$opright'
)
THEN
- EXECUTE \$postgis_proc_upgrade_parsed_def\$ $def \$postgis_proc_upgrade_parsed_def\$;
- END IF;
+$def
+EOF
+
+ my $ELSE="ELSE -- version_from >= $last_updated";
+ for my $subobj (@subobjects)
+ {
+ my $last_updated = @{$subobj}[0];
+ my $attr = @{$subobj}[1];
+ my $val = @{$subobj}[2];
+ print <<"EOF";
+ ${ELSE}
+ -- Last Updated: ${last_updated}
+ IF $last_updated > version_from_num FROM _postgis_upgrade_info() THEN
+ ALTER OPERATOR ${opname} ( $opleft, $opright ) SET ( ${attr} = ${val} );
+ END IF;
+EOF
+ $ELSE="";
+ }
+
+ print <<"EOF";
+ END IF; -- version_from >= $last_updated
END
\$postgis_proc_upgrade\$;
EOF
+
}
# Always output create ore replace view (see ticket #1097)
-----------------------------------------------------------------------
Summary of changes:
postgis/postgis.sql.in | 12 +++++++--
regress/core/regress_selectivity_expected | 4 +--
utils/create_upgrade.pl | 45 ++++++++++++++++++++++++++++---
3 files changed, 53 insertions(+), 8 deletions(-)
hooks/post-receive
--
PostGIS
More information about the postgis-tickets
mailing list