Skip to content

Commit 318fa2d

Browse files
mmcfarlandbitner
andauthored
Remove default eo:cloud_cover queryable (#210)
* Remove default eo:cloud_cover queryable This default queryable was added in the early days of pgstac so that the field would be indexed by default if it was present in any items. However, now that the queryables table is used to generate content for /queryables stac endpoint, it is included in the queryable content for all collections (since there is no collection_id). Removing this opmtimization fixes incorrect (and broken, since the $ref url also has a typo) default behavior. * stage migration --------- Co-authored-by: David Bitner <[email protected]>
1 parent cdcd1f9 commit 318fa2d

File tree

4 files changed

+1
-28
lines changed

4 files changed

+1
-28
lines changed

docs/src/pgstac.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ In general, you should aim to keep each partition less than a few hundred thousa
9898
9999
#### PGStac Indexes / Queryables
100100
101-
By default, PGStac includes indexes on the id, datetime, collection, geometry, and the eo:cloud_cover property. Further indexing can be added for additional properties globally or only on particular collections by modifications to the queryables table.
101+
By default, PGStac includes indexes on the id, datetime, collection, and geometry. Further indexing can be added for additional properties globally or only on particular collections by modifications to the queryables table.
102102
103103
The `queryables` table controls the indexes that PGStac will build as well as the metadata that is returned from a [STAC Queryables endpoint](https://github.com/stac-api-extensions/filter#queryables).
104104

src/pgstac/migrations/pgstac.0.7.10-unreleased.sql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -286,15 +286,6 @@ DO $$
286286
END
287287
$$;
288288

289-
DO $$
290-
BEGIN
291-
INSERT INTO queryables (name, definition, property_wrapper, property_index_type) VALUES
292-
('eo:cloud_cover','{"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fieldsproperties/eo:cloud_cover"}','to_int','BTREE');
293-
EXCEPTION WHEN unique_violation THEN
294-
RAISE NOTICE '%', SQLERRM USING ERRCODE = SQLSTATE;
295-
END
296-
$$;
297-
298289
DELETE FROM queryables a USING queryables b
299290
WHERE a.name = b.name AND a.collection_ids IS NOT DISTINCT FROM b.collection_ids AND a.id > b.id;
300291

src/pgstac/migrations/pgstac.unreleased.sql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4069,15 +4069,6 @@ DO $$
40694069
END
40704070
$$;
40714071

4072-
DO $$
4073-
BEGIN
4074-
INSERT INTO queryables (name, definition, property_wrapper, property_index_type) VALUES
4075-
('eo:cloud_cover','{"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fieldsproperties/eo:cloud_cover"}','to_int','BTREE');
4076-
EXCEPTION WHEN unique_violation THEN
4077-
RAISE NOTICE '%', SQLERRM USING ERRCODE = SQLSTATE;
4078-
END
4079-
$$;
4080-
40814072
DELETE FROM queryables a USING queryables b
40824073
WHERE a.name = b.name AND a.collection_ids IS NOT DISTINCT FROM b.collection_ids AND a.id > b.id;
40834074

src/pgstac/sql/998_idempotent_post.sql

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,6 @@ DO $$
2525
END
2626
$$;
2727

28-
DO $$
29-
BEGIN
30-
INSERT INTO queryables (name, definition, property_wrapper, property_index_type) VALUES
31-
('eo:cloud_cover','{"$ref": "https://stac-extensions.github.io/eo/v1.0.0/schema.json#/definitions/fieldsproperties/eo:cloud_cover"}','to_int','BTREE');
32-
EXCEPTION WHEN unique_violation THEN
33-
RAISE NOTICE '%', SQLERRM USING ERRCODE = SQLSTATE;
34-
END
35-
$$;
36-
3728
DELETE FROM queryables a USING queryables b
3829
WHERE a.name = b.name AND a.collection_ids IS NOT DISTINCT FROM b.collection_ids AND a.id > b.id;
3930

0 commit comments

Comments
 (0)