Skip to content

Commit

Permalink
Merge pull request #7 from cyliu0/mysql-covered-index
Browse files Browse the repository at this point in the history
src/lua: create covered index for mysql
  • Loading branch information
cyliu0 authored Nov 10, 2023
2 parents 751c648 + 36d7af4 commit 1bb8620
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/lua/oltp_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -263,9 +263,14 @@ CREATE TABLE sbtest%d(
end
if (not sysbench.opt.skip_ddl) and sysbench.opt.create_covered_secondary then
print(string.format("Creating a covered secondary index on 'sbtest%d'...",
table_num))
con:query(string.format("CREATE INDEX ck_%d ON sbtest%d(k) include(id, c, pad)",
table_num, table_num))
table_num))
if drv:name() == "mysql" then
con:query(string.format("CREATE INDEX ck_%d ON sbtest%d(k, id, c, pad)",
table_num, table_num))
else
con:query(string.format("CREATE INDEX ck_%d ON sbtest%d(k) include(id, c, pad)",
table_num, table_num))
end
end
end

Expand Down

0 comments on commit 1bb8620

Please sign in to comment.