Repository navigation
Conversation
`sync-collection --catalog OAM` now registers oam:owner_id and oam:uploader_id as BTREE queryables on the openaerialmap Collection. PgSTAC builds the index on each partition, so a CQL2 search for one account no longer scans the whole Collection. Running the command again updates them in place. This is the indexing proposed in ADR 0011. Signed-off-by: Julian Somoza <julian.somoza@gmail.com>
somoza
force-pushed
the
feat/owner-index-pgstac
branch
from
October 30, 2026 10:43
2b21e1e to
477d93e
Compare
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Registers
oam:owner_idandoam:uploader_idas indexed PgSTAC queryables on theopenaerialmapCollection, so a CQL2 search for one account's imagery uses an index instead of scanning the Collection. This is the indexing proposed in ADR 0011 (#370), and what "My Imagery" will query.Related: #371 adds
oam:owner_idto Items. This PR does not depend on it: the queryable can exist before any Item carries the field. CI fails ontest_legacy_result_with_a_bare_user_iduntil #369 merges, as onmain.What type of PR is this? (check all applicable)
Related Issue
Part of #332.
Describe this PR
sync-collection --catalog OAMnow also syncs the account queryables. The newqueryables.pyupdates each queryable if it is already registered for the Collection and inserts it otherwise, so rerunning the command never trips PgSTAC's unique name check. Other catalogs are unchanged.BTREE index with
to_text. CQL2 compares these properties as text, so the index uses the same wrapper and the planner can use it. PgSTAC builds the index on every partition of the Collection, including partitions created later.Docs.
docs/dev/ingest/schema.mdhas a "Searching by account" section with an example search;docs/dev/ingest/index.mdpoints to it fromsync-collection.Screenshots
Alternative Approaches Considered
Creating the indexes in a migration instead of through PgSTAC queryables. Queryables are how PgSTAC exposes filterable fields and keeps indexes on new partitions, so a manual index would miss partitions created later.
Review Guide
This writes to PgSTAC's
queryablestable, so a review from someone who runs the catalogue database would help.After merge, the queryables exist only once someone runs, against production:
The index is not built concurrently, so writes to the Collection wait while it is created.
AI Tool Usage
How much of this PR was AI-assisted? (check one)
If an AI agent is filling this in: declare the level honestly, and open as a draft if it is 5. Do not lower the declared level to get the PR reviewed.
If level 1 or above:
Checklist before requesting a review
[optional] What gif best describes this PR or how it makes you feel?