-
Notifications
You must be signed in to change notification settings - Fork 11.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
indexer: cp sequence number for tx indices query perf #16617
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
tx_sequence_number BIGINT NOT NULL, | ||
-- Object ID in bytes. | ||
object_id BYTEA NOT NULL, | ||
PRIMARY KEY(object_id, tx_sequence_number, cp_sequence_number) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
q: how come some of these tx_
tables have an index, and others don't?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
those indices were added for tx_reader, others count on the primary key.
sender BYTEA NOT NULL, | ||
PRIMARY KEY(sender, tx_sequence_number, cp_sequence_number) | ||
); | ||
CREATE INDEX tx_senders_tx_sequence_number_index ON tx_senders (tx_sequence_number ASC, cp_sequence_number ASC); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when issuing a query, will we need to include order by cp_sequence_number asc
or desc
in order to leverage this index on scan or scan backward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this index can be used for both forward and backward scans.
https://www.postgresql.org/docs/current/indexes-ordering.html
The index can also be scanned backward ...
in fact, it's a bit verbose here to specify ASC
as it's the default one, I will remove it in a following PR I am working on
…Labs#16617)" This reverts commit 75afd6c.
…)"" This reverts commit c47b362.
…Labs#16617)" This reverts commit 75afd6c.
…Labs#16617)" This reverts commit 75afd6c.
…" (#16816) This reverts commit 75afd6c. ## Description This is an indexer breaking change and as a result should not be merged just yet before the corresponding backfill is done. ## Test Plan test on benchmark to make sure that after this revert, the schema is compatible with one before. ## Prevention Plan next time for breaking change, I will add `[NO COMMIT] indexer breaking change` as the prefix. --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
…)"" This reverts commit c47b362.
…" (#16816) This reverts commit 75afd6c. ## Description This is an indexer breaking change and as a result should not be merged just yet before the corresponding backfill is done. ## Test Plan test on benchmark to make sure that after this revert, the schema is compatible with one before. ## Prevention Plan next time for breaking change, I will add `[NO COMMIT] indexer breaking change` as the prefix. --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
…enLabs#16617)"" This reverts commit c47b362.
…enLabs#16617)"" This reverts commit c47b362.
…enLabs#16617)"" This reverts commit c47b362.
…)"" This reverts commit c47b362.
…)"" This reverts commit c47b362.
## Description title also merged the schema files of tx indices for simplicity ## Test Plan local cargo run to make sure that the column can be populated properly --- If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section. ### Type of Change (Check all that apply) - [ ] protocol change - [ ] user-visible impact - [ ] breaking change for a client SDKs - [ ] breaking change for FNs (FN binary must upgrade) - [ ] breaking change for validators or node operators (must upgrade binaries) - [ ] breaking change for on-chain data layout - [ ] necessitate either a data wipe or data migration ### Release notes
Description
title
also merged the schema files of tx indices for simplicity
Test Plan
local cargo run to make sure that the column can be populated properly
If your changes are not user-facing and do not break anything, you can skip the following section. Otherwise, please briefly describe what has changed under the Release Notes section.
Type of Change (Check all that apply)
Release notes