yugabyte / tpcc

Repo to run TPCC benchmarks against YugabyteDB
Other
24 stars 21 forks source link

Avoid using join for StockLevel transaction. #58

Closed psudheer21 closed 3 years ago

psudheer21 commented 4 years ago

Summary: StockLevel uses a join across OrderLine and Stock tables to get the stock of the items present in the last 20 transactions. Performing an explain on the query showed that we use a NestedLoop across the 2 tables with the query on the Stock table being a point lookup.

Avoid this expensive reads using the select in syntax.

The average latency of the transaction reduces by 40%. Old Change: Avg Latency: 87.026 msecs, p99 Latency: 463.411 msecs New Change: Avg Latency: 49.694 msecs, p99 Latency: 570.755 msecs

Reviewers: Mihnea

robertsami commented 3 years ago

lets close this in favor of https://github.com/yugabyte/tpcc/pull/75