From 9166cc013621b773b1ff662b301015452ab68a18 Mon Sep 17 00:00:00 2001 From: Claus Nagel Date: Mon, 23 Dec 2024 07:13:14 +0100 Subject: [PATCH] reflected latest changes in 3dcitydb repo --- .../sql-scripts/citydb-pkg/delete.sql | 8 ++++++-- .../postgresql/sql-scripts/schema/schema.sql | 18 +++++++++--------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/resources/3dcitydb/postgresql/sql-scripts/citydb-pkg/delete.sql b/resources/3dcitydb/postgresql/sql-scripts/citydb-pkg/delete.sql index 774dec7..9b613e2 100644 --- a/resources/3dcitydb/postgresql/sql-scripts/citydb-pkg/delete.sql +++ b/resources/3dcitydb/postgresql/sql-scripts/citydb-pkg/delete.sql @@ -201,7 +201,7 @@ BEGIN (SELECT DISTINCT unnest(feature_ids) AS a_id) a LEFT JOIN property p - ON p.val_feature_id = a.a_id + ON p.val_feature_id = a.a_id WHERE p.val_feature_id IS NULL OR p.val_relation_type IS NULL OR p.val_relation_type = 0; END IF; @@ -216,7 +216,11 @@ BEGIN PERFORM citydb_pkg.delete_implicit_geometry(array_agg(a.a_id)) FROM - (SELECT DISTINCT unnest(implicit_geometry_ids) AS a_id) a; + (SELECT DISTINCT unnest(implicit_geometry_ids) AS a_id) a + LEFT JOIN + property p + ON p.val_implicitgeom_id = a.a_id + WHERE p.val_implicitgeom_id IS NULL; END IF; IF -1 = ALL(appearance_ids) IS NOT NULL THEN diff --git a/resources/3dcitydb/postgresql/sql-scripts/schema/schema.sql b/resources/3dcitydb/postgresql/sql-scripts/schema/schema.sql index d731c1d..906f439 100644 --- a/resources/3dcitydb/postgresql/sql-scripts/schema/schema.sql +++ b/resources/3dcitydb/postgresql/sql-scripts/schema/schema.sql @@ -233,31 +233,31 @@ CREATE INDEX property_namespace_inx ON property ( namespace_id ); CREATE INDEX property_name_inx ON property ( name ); -CREATE INDEX property_val_feature_fkx ON property ( val_feature_id ) WHERE val_feature_id IS NOT NULL; - CREATE INDEX property_val_string_inx ON property ( val_string ) WHERE val_string IS NOT NULL; CREATE INDEX property_val_uom_inx ON property ( val_uom ) WHERE val_uom IS NOT NULL; CREATE INDEX property_val_uri_inx ON property ( val_uri ) WHERE val_uri IS NOT NULL; -CREATE INDEX property_val_lod_inx ON property ( val_lod ) WHERE val_lod IS NOT NULL; - CREATE INDEX property_val_int_inx ON property ( val_int ) WHERE val_int IS NOT NULL; CREATE INDEX property_val_double_inx ON property ( val_double ) WHERE val_double IS NOT NULL; CREATE INDEX property_val_date_inx ON property ( val_timestamp ) WHERE val_timestamp IS NOT NULL; -CREATE INDEX property_val_geometry_fkx ON property ( val_geometry_id ) WHERE val_geometry_id IS NOT NULL; +CREATE INDEX property_val_feature_fkx ON property ( val_feature_id ); + +CREATE INDEX property_val_geometry_fkx ON property ( val_geometry_id ); + +CREATE INDEX property_val_implicitgeom_fkx ON property ( val_implicitgeom_id ); -CREATE INDEX property_val_implicitgeom_fkx ON property ( val_implicitgeom_id ) WHERE val_implicitgeom_id IS NOT NULL; +CREATE INDEX property_val_appearance_fkx ON property ( val_appearance_id ); -CREATE INDEX property_val_appearance_fkx ON property ( val_appearance_id ) WHERE val_appearance_id IS NOT NULL; +CREATE INDEX property_val_relation_type_inx ON property ( val_relation_type ); -CREATE INDEX property_val_relation_type_inx ON property ( val_relation_type ) WHERE val_relation_type IS NOT NULL; +CREATE INDEX property_val_address_fkx ON property ( val_address_id ); -CREATE INDEX property_val_address_fkx ON property ( val_address_id ) WHERE val_address_id IS NOT NULL; +CREATE INDEX property_val_lod_inx ON property ( val_lod ); CREATE TABLE surface_data ( id bigint DEFAULT nextval('surface_data_seq'::regclass) NOT NULL ,