diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java index 611e5628..66c53379 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/Delivery.java @@ -38,7 +38,7 @@ public class Delivery extends TPCCProcedure { SELECT NO_O_ID FROM %s WHERE NO_D_ID = ? AND NO_W_ID = ? - ORDER BY NO_O_ID ASC + ORDER BY NO_W_ID ASC, NO_D_ID ASC, NO_O_ID ASC LIMIT 1 """.formatted(TPCCConstants.TABLENAME_NEWORDER)); diff --git a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java index f66e5386..85054d50 100644 --- a/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java +++ b/src/main/java/com/oltpbenchmark/benchmarks/tpcc/procedures/OrderStatus.java @@ -45,7 +45,7 @@ public class OrderStatus extends TPCCProcedure { WHERE idx.O_W_ID = ? AND idx.O_D_ID = ? AND idx.O_C_ID = ? - ORDER BY idx.O_ID DESC LIMIT 1 + ORDER BY idx.O_W_ID DESC, idx.O_D_ID DESC, idx.O_C_ID DESC, idx.O_ID DESC LIMIT 1 """.formatted(TPCCConstants.TABLENAME_OPENORDER)); public SQLStmt ordStatGetOrderLinesSQL = new SQLStmt(