Skip to content

Query optimization + add new col for transaction in/out - #43

Merged
dewabisma merged 6 commits into
mainfrom
beast/queries-optimization
Jul 28, 2026
Merged

Query optimization + add new col for transaction in/out#43
dewabisma merged 6 commits into
mainfrom
beast/queries-optimization

Conversation

@dewabisma

@dewabisma dewabisma commented Jul 28, 2026

Copy link
Copy Markdown
Collaborator

Note

Medium Risk
Home and search metrics switch data sources and filters, so dashboards and search results can diverge from the old aggregates; block reward rows depend on the null-hash immediate-transfer heuristic.

Overview
GraphQL operations are reshaped for cheaper reads and clearer block/search behavior, with this PR’s visible diff in the generated gql.ts registry.

Home dashboard (GetHomeChainStats) drops the old pattern of fourteen timestamp variables and per-day block_aggregate / transfer_aggregate / distinct from_id counts. It now takes $last24HourWhere on unified_transaction_aggregate and loads chart series from daily_chain_stats (blocks_count, tx_count, active_accounts) with $dayLimit.

Global search replaces monolithic SearchAll with SearchHex, SearchNumeric, and SearchText so each input shape hits a smaller query (e.g. _like on hashes/detail ids, numeric block height, accounts/errors only on text). Broad id / _ilike transaction matches are removed from the combined search path.

Block detail (GetBlockById) adds rewardTransfers: immediate unified_transaction rows with null hash for the block, including from / to for in/out display.

Codegen no longer registers GetUnifiedTransactions, GetRecentUnifiedTransactions, or GetUnifiedTransactionsStats here (those operations are defined elsewhere, e.g. inline in the unified-transactions API with optimized totals).

Reviewed by Cursor Bugbot for commit 48672ee. Configure here.

@dewabisma
dewabisma merged commit 751a528 into main Jul 28, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant