feat: add analyst-friendly ClickHouse views - #53
Merged
Conversation
Contributor
|
Hey @Leomrqdd, thanks for this PR! I can see how these can be useful, however I'm hesitant to include them in the base install as they will consume additional resources not strictly required for serving spec data. Would you be willing to put these in a different directory for additional resources instead? |
Author
|
Sure! I was not sure where to put the files to be honest. I’ll move the views out of the base DDL install into ddl/additional/ (opt-in, not wired into Docker Compose). |
Move the plain views out of the base schema sets and stop applying them in Compose, so the default install only includes objects needed to serve spec data.
notwedtm
approved these changes
Aug 31, 2026
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.
Summary
Adds four plain (non-materialized) SQL views over
default.transactionsfor ad-hoc analytics. They encapsulate three pitfalls of the raw schema: binary keys (re-encoded to base58), ALT-loaded accounts (merged so account filters do not miss v0 transactions), and vote transactions (pre-filtered in the analytical views).tx_summarysol_transferstoken_transferstransactions_decodedtransactions(votes included)Changes
view_*.sqlfiles following the existing DDL convention: same basenames inddl/local/,ddl/cluster/, andddl/replicated/(clustered variants useON CLUSTER '{cluster}'; they are otherwise identical since plain views store nothing). The views are optional and only requiredefault.transactions.clickhouse-ddlservice applies them after the base DDL. Tilt/k8s deploy manifests are intentionally left untouched.docs/analyst-views.mddocuments semantics, consistency checks, performance notes, and 7 example queries; indexed indocs/README.mdand referenced fromddl/README.md.Testing
Tested against 100 mainnet slots (115k transactions, ClickHouse 26.1) ingested via the
ingest-rpcCompose profile.