Skip to content

Commit

Permalink
src/lua: create covered index for mysql
Browse files Browse the repository at this point in the history
  • Loading branch information
cyliu0 committed Nov 10, 2023
1 parent 3dcc87b commit 36d7af4
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions src/lua/oltp_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -261,11 +261,16 @@ CREATE TABLE sbtest%d(
con:query(string.format("CREATE INDEX k_%d ON sbtest%d(k)",
table_num, table_num))
end
if (not sysbench.opt.skip_ddl) and sysbench.opt.create_covered_secondary and drv:name() ~= "mysql" then
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 36d7af4

Please sign in to comment.