diff options
| author | Even Rouault <even.rouault@spatialys.com> | 2021-04-04 22:44:07 +0200 |
|---|---|---|
| committer | Even Rouault <even.rouault@spatialys.com> | 2021-04-06 23:30:19 +0200 |
| commit | 950ce787b26b3b3afd0ff76151fdf72d1381b7a1 (patch) | |
| tree | b2d70e6c7151361c6cf9e99592ada7386c4a1d95 /data/sql | |
| parent | f85b0723136eed9891569b988607f07ef185d504 (diff) | |
| download | PROJ-950ce787b26b3b3afd0ff76151fdf72d1381b7a1.tar.gz PROJ-950ce787b26b3b3afd0ff76151fdf72d1381b7a1.zip | |
Database: nullify auth_name, code of usage table
We never select by those columns, so don't set them. Reduce from 8.4 to
7.9 MB.
Upgrade the minor version of the database layout. (that database can
still be read by PROJ 8.0)
Diffstat (limited to 'data/sql')
| -rw-r--r-- | data/sql/commit.sql | 3 | ||||
| -rw-r--r-- | data/sql/metadata.sql | 2 | ||||
| -rw-r--r-- | data/sql/proj_db_table_defs.sql | 6 |
3 files changed, 7 insertions, 4 deletions
diff --git a/data/sql/commit.sql b/data/sql/commit.sql index 7a4b74ad..3cdb0861 100644 --- a/data/sql/commit.sql +++ b/data/sql/commit.sql @@ -9,6 +9,9 @@ CREATE INDEX grid_transformation_idx ON grid_transformation(source_crs_auth_name CREATE INDEX other_transformation_idx ON other_transformation(source_crs_auth_name, source_crs_code, target_crs_auth_name, target_crs_code); CREATE INDEX concatenated_operation_idx ON concatenated_operation(source_crs_auth_name, source_crs_code, target_crs_auth_name, target_crs_code); +-- We don't need to select by auth_name, code so nullify them to save space +UPDATE usage SET auth_name = NULL, code = NULL; + -- Final consistency checks CREATE TABLE dummy(foo); CREATE TRIGGER final_checks diff --git a/data/sql/metadata.sql b/data/sql/metadata.sql index bb8e3095..93b4c62e 100644 --- a/data/sql/metadata.sql +++ b/data/sql/metadata.sql @@ -7,7 +7,7 @@ -- DATABASE_LAYOUT_VERSION_MINOR constants in src/iso19111/factory.cpp must be -- updated as well. INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MAJOR', 1); -INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 0); +INSERT INTO "metadata" VALUES('DATABASE.LAYOUT.VERSION.MINOR', 1); INSERT INTO "metadata" VALUES('EPSG.VERSION', 'v10.018'); INSERT INTO "metadata" VALUES('EPSG.DATE', '2021-04-02'); diff --git a/data/sql/proj_db_table_defs.sql b/data/sql/proj_db_table_defs.sql index 08f74c34..9b1d3dce 100644 --- a/data/sql/proj_db_table_defs.sql +++ b/data/sql/proj_db_table_defs.sql @@ -86,8 +86,8 @@ CREATE TABLE scope( ); CREATE TABLE usage( - auth_name TEXT NOT NULL CHECK (length(auth_name) >= 1), - code INTEGER_OR_TEXT NOT NULL CHECK (length(code) >= 1), + auth_name TEXT CHECK (auth_name IS NULL OR length(auth_name) >= 1), + code INTEGER_OR_TEXT CHECK (code IS NULL OR length(code) >= 1), object_table_name TEXT NOT NULL CHECK (object_table_name IN ( 'geodetic_datum', 'vertical_datum', 'geodetic_crs', 'projected_crs', 'vertical_crs', 'compound_crs', @@ -1490,7 +1490,7 @@ CREATE VIEW authority_list AS UNION SELECT DISTINCT auth_name FROM scope UNION - SELECT DISTINCT auth_name FROM usage + SELECT DISTINCT auth_name FROM usage WHERE auth_name IS NOT NULL UNION SELECT DISTINCT auth_name FROM prime_meridian UNION |
