You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
For non-unique indexes, the primary key of the main table is implicitly added to the DocDB key, guaranteeing uniqueness of the full DocDB key (indexed columns plus encoded base table primary key).
Therefore, we can just execute such inserts as upserts and avoid the read and uniqueness check.
We already do this for YCQL (see cql_operation.cc).
The text was updated successfully, but these errors were encountered:
Summary:
For non-unique indexes, the primary key of the main table is implicitly added
to the DocDB key, guaranteeing uniqueness of the full DocDB key (indexed
columns plus encoded base table primary key).
Therefore, we can just execute such inserts as upserts and avoid the read and
uniqueness check.
We already do this for YCQL (in cql_operation.cc).
Test Plan:
Existing Jenkins tests.
Tested locally with SqlSecondaryIndex sample app:
```
java -jar target/yb-sample-apps.jar --workload SqlSecondaryIndex --nodes 127.0.0.1:5433 --num_threads_read 4 --num_threads_write 4
```
- Before:
```
120649 [Thread-1] INFO com.yugabyte.sample.common.metrics.MetricsTracker -
Read: 2576.59 ops/sec (1.55 ms/op), 335179 total ops |
Write: 1608.69 ops/sec (2.49 ms/op), 204802 total ops |
Uptime: 120097 ms |
```
- After:
```
120660 [Thread-1] INFO com.yugabyte.sample.common.metrics.MetricsTracker -
Read: 2796.42 ops/sec (1.43 ms/op), 372056 total ops |
Write: 1656.78 ops/sec (2.41 ms/op), 219060 total ops |
Uptime: 120102 ms |
```
- Summary:
Reads: 335179 -> 372056 (~11% increase)
Writes: 204802 -> 219060 (~7% increase)
Note: This uses RF-1 cluster and one index -- improvement should be less for RF-3 and better for more indexes.
Reviewers: neha
Reviewed By: neha
Subscribers: kannan, yql
Differential Revision: https://phabricator.dev.yugabyte.com/D8385
For non-unique indexes, the primary key of the main table is implicitly added to the DocDB key, guaranteeing uniqueness of the full DocDB key (indexed columns plus encoded base table primary key).
Therefore, we can just execute such inserts as upserts and avoid the read and uniqueness check.
We already do this for YCQL (see cql_operation.cc).
The text was updated successfully, but these errors were encountered: