Tagged Variants grid search box optimisation: a search takes about 12 s with 200k tags
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
- 52/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Stack tecnologico
- postgresql, python
- Ambito
- databases, performance
Direzione di ricerca
Start with snpdb/views/datatable_view.py and variantopedia/grids.py, then inspect how DatatableConfig.power_search builds filters for VariantTagsColumns. Compare the current search plan with the proposed key lookup for annotations, coordinates, and related tables, including tags lifted from other builds. Measure the full search and count path on the 200k-tag dataset; done means searches approach the unsearched grid cost while preserving the documented matching behavior.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
🤖 Written by Claude
On Variants → Tagged Variants, searching in the Tags grid's Search box takes about 12 s on a database with 200k tags (vg-test2, GRCh37, lab user). The grid's other actions take about 5 s once #2878 / PR #2879 lands. A search for "GATA2", which matches 5 tags, takes 12.1 s on the PR.
What the search box matches
The text is matched case-insensitively as "contains" against every searchable column, ORed together:
- Variant (coordinate string), Gene, g.HGVS (hidden)
- Tag, Analysis id and name, Sample name, Patient identity, username and full name
- Tag ID, Variant ID and the created date, each cast to text
snpdb/views/datatable_view.py:DatatableConfig.power_search does this for every grid. The Tags grid is variantopedia/grids.py:VariantTagsColumns.
Where the time goes
Each search runs the filter twice, once for the count and once for the page, at about 6 s each. Variant and Gene are computed for each tag through the build's variant, annotation and gene joins, so Postgres computes them for every tag before it can filter.
Each column searched on its own (2.8 s of each figure is the grid with no search):
| Column | Time |
|---|---|
| Gene | 5.1 s |
| Variant | 3.5 s |
| g.HGVS | 2.7 s |
| Patient | 2.1 s |
| Each of the rest | under 1 s |
| All together, as the grid does it | 6.2 s |
Matching the same text against the annotation's gene symbol directly, for tagged variants only, takes 0.09 s.
Proposed approach
Resolve the search text to keys first, then filter tags on indexed columns:
- Gene symbol and g.HGVS: match against the build's annotation partition for tagged variants, going through the tag's allele as well as its variant. The grid also shows tags lifted over from other builds: the direct SQL above found 4 tags where the grid finds 5.
- Coordinate: when the text parses as a coordinate (
VariantCoordinate), look the variant up directly. - Tag, user, analysis, sample, patient: match in their own small tables.
- Filter: keep tags whose variant, allele or foreign keys are in those sets.
Numbers as text
The ID and created-date columns match by casting to text. Typing 12 matches every tag whose ID, variant ID or created date contains "12". Those columns could match only when the text is a whole number, and then by equality.
Expected outcome
A search should take close to the grid's unsearched cost (about 3 s after #2878), not 12 s. Not yet built or measured end to end.
- Lingua principale
- Python
- Stelle
- 31
- Fork
- 4
- Merge medio
- 4h 52m
- PR unite (30g)
- 183
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di SACGF/variantgrid
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 69/100
SACGF/variantgrid#2964 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Genome build now duplicated in "imported as" on allele pageForse già presa @TheMadBug l’ha presa 3 giorni fa. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 67/100
SACGF/variantgrid#2950 · 1 commento · 1 assegnatario ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
SACGF/variantgrid#2865 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
SACGF/variantgrid#2647 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 79/100
SACGF/variantgrid#2341 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di SACGF/variantgrid
Issue simili
-
Test: to_hijri() accepts datetime.datetime and uses only the date partForse già presa Una pull request collegata a questa issue è aperta o già unita. Apertagood first issue
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 95/100
omarelshamy25x/shamy-hijri#63 · 3 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
polish
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
521xueweihan/HelloGitHub#4729 ·
-
[Bug]: Score parser reads parts of scientific notation as valid scoresForse già presa @AshutoshSingh840 l’ha presa oggi. Aperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
UKGovernmentBEIS/control-arena#992 ·
I maintainer di solito rispondono entro 3 giorni
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 92/100
mvalentsev/awesome-free-ai-coding#70 ·
I maintainer di solito rispondono entro 1 giorno