From 9e4a9d4cf560400514012fa4aa2853440922e79e Mon Sep 17 00:00:00 2001 From: Jeremy Cole Date: Tue, 23 Aug 2016 13:20:35 -0700 Subject: [PATCH] Create indexes after data load in parallel_prepare Creating indexes after the data has been loaded is much faster. --- sysbench/tests/db/common.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sysbench/tests/db/common.lua b/sysbench/tests/db/common.lua index 6aabecd..c0dd581 100644 --- a/sysbench/tests/db/common.lua +++ b/sysbench/tests/db/common.lua @@ -59,8 +59,6 @@ pad CHAR(60) DEFAULT '' NOT NULL, db_query(query) - db_query("CREATE INDEX k_" .. i .. " on sbtest" .. i .. "(k)") - print("Inserting " .. oltp_table_size .. " records into 'sbtest" .. i .. "'") if (oltp_auto_inc) then @@ -89,6 +87,8 @@ pad CHAR(60) DEFAULT '' NOT NULL, db_bulk_insert_done() + print("Creating secondary indexes on 'sbtest" .. i .. "'...") + db_query("CREATE INDEX k_" .. i .. " on sbtest" .. i .. "(k)") end