Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Remove O(m) DB queries

Aperta
#316 1 commento 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
5/5
Tempo stimato
Più di una settimana
Idoneità per principianti
25/100
Tipo di issue
Funzionalità
Chiarezza
Da chiarire
Stato di attività
Ferma
Stack tecnologico
typescript

Direzione di ricerca

Inizia individuando i punti di ingresso dell’Indexer per le query Asset-type UTXO, l’aggregazione degli account, la creazione degli snapshot e le API utilizzate dal wallet web o dall’Hub. Esamina come queste query scandiscono attualmente i risultati e determina le modifiche necessarie all’API e al consumer affinché i risultati vengano recuperati in batch limitati; il lavoro è completato quando nessuna singola richiesta scansiona tutti gli m UTXO.

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

Descrizione

When querying UTXOs using Asset type, aggregating UTXOs by account, and creating a snapshot, the Indexer scans all the UTXOs that have a specific account or a specific asset type.

When a user opens a CodeChain web wallet, wallet requests the total amount of assets that the user has to the Indexer. Indexer sends a query that scans all the UTXOs that the user has. If the number of UTXOs that the user has is m, the upper bound of the query is O(m).

How to solve

Make APIs return sub results that read k rows in the DB. The Web wallet or Hub should request the maximum [n/k] number of API calls to get all the results. The upper bound of each query is O(k*log m). Then there won't be a single slow query that consumes all the resources(CPU, Memory, disk I/O) in the DB.

Lingua principale
TypeScript
Stelle
21
Fork
15
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Preparare l'ambiente

  • Include un Dockerfile o un file Docker Compose
  • Nessun modello di pull request
  • Nessuna guida per i contributori

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 CodeChain-io/codechain-indexer

Tutte le issue di CodeChain-io/codechain-indexer

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.