Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions tpcc_common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,58 @@ function create_tables(drv, con, table_num)

con:query(query)

if drv:name() == "pgsql" then
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_name SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_street_1 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_street_2 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_city SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_state SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_zip SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_tax SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE warehouse%d ALTER w_ytd SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_name SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_street_1 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_street_2 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_city SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_state SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_zip SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_tax SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE district%d ALTER d_ytd SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_first SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_middle SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_last SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_street_1 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_street_2 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_city SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_state SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_zip SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_phone SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_credit SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_discount SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_balance SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_ytd_payment SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE customer%d ALTER c_data SET STORAGE EXTERNAL ]], table_num))
con:query(string.format([[ ALTER TABLE history%d ALTER h_amount SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE history%d ALTER h_data SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE order_line%d ALTER ol_amount SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE order_line%d ALTER ol_dist_info SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE item%d ALTER i_name SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE item%d ALTER i_price SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE item%d ALTER i_data SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_01 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_02 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_03 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_04 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_05 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_06 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_07 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_08 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_09 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_dist_10 SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_ytd SET STORAGE PLAIN ]], table_num))
con:query(string.format([[ ALTER TABLE stock%d ALTER s_data SET STORAGE PLAIN ]], table_num))
end

con:bulk_insert_init("INSERT INTO item" .. i .." (i_id, i_im_id, i_name, i_price, i_data) values")
for j = 1 , MAXITEMS do
local i_im_id = sysbench.rand.uniform(1,10000)
Expand Down