From f2b55de29bd31cde5798d0ad2da4eb5f5e555ded Mon Sep 17 00:00:00 2001 From: Ashok Menon Date: Wed, 15 May 2024 01:13:26 +0100 Subject: [PATCH] [Indexer] Create `objects_version` table. (#17542) This table maps an object's ID and version to a checkpoint sequence number, in a table partitioned by the first byte of the object ID. This speeds up look ups into `objects_history` by offering a path for a first look-up to the correct partition in that table for a given object's ID and version. This PR introduces the table, and the logic to populate it in the indexer. ``` sui$ cargo nextest run -p sui-indexer sui$ cargo nextest run -p sui-graphql-rpc sui$ cargo nextest run -p sui-graphql-e2e-tests --features pg_integration ``` A future PR will make use of this table from GraphQL, which will test it further. - #17686 - #17687 - #17688 - #17689 - #17691 - #17694 - #17695 --- 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: --- crates/sui-indexer/src/schema/pg.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/crates/sui-indexer/src/schema/pg.rs b/crates/sui-indexer/src/schema/pg.rs index f1de68d061bc3..5e55d9b7764ae 100644 --- a/crates/sui-indexer/src/schema/pg.rs +++ b/crates/sui-indexer/src/schema/pg.rs @@ -292,6 +292,7 @@ diesel::table! { } } +<<<<<<< HEAD diesel::table! { tx_recipients (recipient, tx_sequence_number) { recipient -> Bytea, @@ -339,3 +340,26 @@ macro_rules! for_all_tables { pub use for_all_tables; for_all_tables!(diesel::allow_tables_to_appear_in_same_query); +======= +diesel::allow_tables_to_appear_in_same_query!( + checkpoints, + display, + epochs, + events, + events_partition_0, + objects, + objects_history, + objects_history_partition_0, + objects_snapshot, + objects_version, + packages, + transactions, + transactions_partition_0, + tx_calls, + tx_changed_objects, + tx_digests, + tx_input_objects, + tx_recipients, + tx_senders, +); +>>>>>>> 749b7e143f ([Indexer] Create `objects_version` table. (#17542))