Skip to content

Commit

Permalink
properly order by to enable server-size optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
eivanov89 committed Aug 22, 2023
1 parent 7508f26 commit b63f501
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit b63f501

Please sign in to comment.