Skip to content

Commit

Permalink
[Indexer] Create objects_version table. (#17542)
Browse files Browse the repository at this point in the history
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:
  • Loading branch information
amnn authored and emmazzz committed Jun 22, 2024
1 parent d3375ee commit f2b55de
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions crates/sui-indexer/src/schema/pg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,7 @@ diesel::table! {
}
}

<<<<<<< HEAD
diesel::table! {
tx_recipients (recipient, tx_sequence_number) {
recipient -> Bytea,
Expand Down Expand Up @@ -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))

0 comments on commit f2b55de

Please sign in to comment.