-
Notifications
You must be signed in to change notification settings - Fork 11.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[3/n][gql-performance] add min_tx_sequence_number and max_tx_sequence…
…_number to checkpoints table (#18244) ## Description Per title - add `min_tx_sequence_number` and `max_tx_sequence_number` to `checkpoints` table to support queries mapping `cp` to a `tx` range. This is so that when given a `checkpoint_sequence_number` range, we can map it to the corresponding `tx_sequence_number` range to facilitate transactions queries. The two new columns are nullable, because it is possible for a checkpoint to not contain any transactions. In practice, we'll typically have at least a commit prologue txn. The nullable columns do not impact the queries we intend to run on the table. If through a CTE, a null value will eventually resolve to FALSE when we attempt to use the min or max tx sequence number in a query against the transactions and tx lookup tables. If we make multiple roundtrips, we can stop early if we see that the range is empty for a checkpoint. ## Test plan Existing tests --- ## Release notes Check each box that your changes affect. If none of the boxes relate to your changes, release notes aren't required. For each box you select, include information after the relevant heading that describes the impact of your changes that a user might notice and any actions they must take to implement updates. - [ ] Protocol: - [ ] Nodes (Validators and Full nodes): - [ ] Indexer: - [ ] JSON-RPC: - [ ] GraphQL: - [ ] CLI: - [ ] Rust SDK:
- Loading branch information
Showing
6 changed files
with
33 additions
and
14 deletions.
There are no files selected for viewing
20 changes: 11 additions & 9 deletions
20
crates/sui-indexer/migrations/pg/2023-08-19-044044_checkpoints/up.sql
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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