Support GIN indexes for queryables

Aperta
#620 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
56/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
helm, postgresql, python

Direzione di ricerca

Start by inspecting the Helm values and chart definitions for queryable indexFields, then read the pypgstac issue linked as #484 and the pgSTAC settings-table approach. Done means GIN can be selected for array fields, BTREE remains the default, and the resulting database state is version-controlled and repeatable without manual SQL changes.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

When we load "queryables" (the list of fields you're allowed to search/filter on in STAC) into pgSTAC, we use pypgstac. This tool builds a search index for each field so lookups are fast, but it only ever builds one kind of index: BTREE.

That's a problem for fields that hold lists of values (arrays), like a tags or categories field. To search those fast, Postgres needs to build a GIN index, which is built specifically for searching inside lists. There's currently no setting/flag in the pypgstac to ask for GIN instead, it always picks BTREE for you.

@bitner confirmed this in this comment: the only way to actually change the index type right now is to log into the database and manually run a SQL command to fix it. We don't want to do that, because it means the database no longer matches what's written in our Helm chart / git repo. The next person who redeploys wouldn't know that manual change ever happened.

Ideas

Keep everything defined in our Helm values (no manual database edits), but add a way to say which index type each field should get. For example:

indexFields:
  - name: "tags"
    type: "gin"
  - name: "roles"   # no type = keep using BTREE, like today

Behind the scenes, the job either needs to set the index type for each field directly in pgSTAC's own settings table, or pypgstac adds support for defining the index type (see https://github.com/stac-utils/pgstac/issues/484)

The point is, we want to automate the changes instead of doing it by hand, so it stays version-controlled and repeatable.

Lingua principale
Python
Stelle
34
Fork
17
Merge medio
1g 9h
PR unite (30g)
56

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di developmentseed/eoapi-k8s

Tutte le issue di developmentseed/eoapi-k8s

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.