Merge branch '1.0'

This commit is contained in:
Alexey Kopytov
2017-08-23 16:20:14 +03:00
5 changed files with 412 additions and 4 deletions

View File

@ -22,9 +22,13 @@
require("oltp_common")
function prepare_statements()
prepare_delete_inserts()
prepare_for_each_table("deletes")
end
function event()
execute_delete_inserts()
local tnum = sysbench.rand.uniform(1, sysbench.opt.tables)
local id = sysbench.rand.default(1, sysbench.opt.table_size)
param[tnum].deletes[1]:set(id)
stmt[tnum].deletes:execute()
end

View File

@ -0,0 +1,201 @@
########################################################################
oltp_delete.lua + MySQL tests
########################################################################
$ . $SBTEST_INCDIR/mysql_common.sh
$ OLTP_SCRIPT_PATH=${SBTEST_SCRIPTDIR}/oltp_delete.lua
$ . $SBTEST_INCDIR/script_oltp_common.sh
sysbench *.* * (glob)
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 10000 records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 10000 records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 10000 records into 'sbtest4'
Creating a secondary index on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 10000 records into 'sbtest5'
Creating a secondary index on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 10000 records into 'sbtest6'
Creating a secondary index on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 10000 records into 'sbtest7'
Creating a secondary index on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 10000 records into 'sbtest8'
Creating a secondary index on 'sbtest8'...
*************************** 1. row ***************************
sbtest1
CREATE TABLE `sbtest1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_1` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest2
CREATE TABLE `sbtest2` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_2` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest3
CREATE TABLE `sbtest3` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_3` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest4
CREATE TABLE `sbtest4` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_4` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest5
CREATE TABLE `sbtest5` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_5` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest6
CREATE TABLE `sbtest6` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_6` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest7
CREATE TABLE `sbtest7` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_7` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
*************************** 1. row ***************************
sbtest8
CREATE TABLE `sbtest8` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`),
KEY `k_8` (`k`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest9' doesn't exist
sysbench * (glob)
Prewarming table sbtest1
Prewarming table sbtest2
Prewarming table sbtest3
Prewarming table sbtest4
Prewarming table sbtest5
Prewarming table sbtest6
Prewarming table sbtest7
Prewarming table sbtest8
sysbench *.* * (glob)
Running the test with following options:
Number of threads: 2
Initializing random number generator from current time
Initializing worker threads...
Threads started!
SQL statistics:
queries performed:
read: 0
write: * (glob)
other: * (glob)
total: 100
transactions: 100 (* per sec.) (glob)
queries: 100 (* per sec.) (glob)
ignored errors: 0 (* per sec.) (glob)
reconnects: 0 (* per sec.) (glob)
General statistics:
total time: *s (glob)
total number of events: 100
Latency (ms):
min: *.* (glob)
avg: *.* (glob)
max: *.* (glob)
95th percentile: *.* (glob)
sum: *.* (glob)
Threads fairness:
events (avg/stddev): */* (glob)
execution time (avg/stddev): */* (glob)
sysbench *.* * (glob)
Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest1' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest2' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest3' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest4' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest5' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest6' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest7' doesn't exist
ERROR 1146 (42S02) at line 1: Table 'sbtest.sbtest8' doesn't exist
# Test --create-secondary=off
sysbench * (glob)
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
*************************** 1. row ***************************
sbtest1
CREATE TABLE `sbtest1` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`k` int(11) NOT NULL DEFAULT '0',
`c` char(120)* NOT NULL DEFAULT '', (glob)
`pad` char(60)* NOT NULL DEFAULT '', (glob)
PRIMARY KEY (`id`)
) ENGINE=InnoDB AUTO_INCREMENT=10001 DEFAULT CHARSET=* (glob)
sysbench * (glob)
Dropping table 'sbtest1'...
# Test --auto-inc=off
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Dropping table 'sbtest1'...

View File

@ -0,0 +1,203 @@
########################################################################
oltp_delete.lua + PostgreSQL tests
########################################################################
$ . $SBTEST_INCDIR/pgsql_common.sh
$ OLTP_SCRIPT_PATH=${SBTEST_SCRIPTDIR}/oltp_delete.lua
$ . $SBTEST_INCDIR/script_oltp_common.sh
sysbench *.* * (glob)
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Creating table 'sbtest2'...
Inserting 10000 records into 'sbtest2'
Creating a secondary index on 'sbtest2'...
Creating table 'sbtest3'...
Inserting 10000 records into 'sbtest3'
Creating a secondary index on 'sbtest3'...
Creating table 'sbtest4'...
Inserting 10000 records into 'sbtest4'
Creating a secondary index on 'sbtest4'...
Creating table 'sbtest5'...
Inserting 10000 records into 'sbtest5'
Creating a secondary index on 'sbtest5'...
Creating table 'sbtest6'...
Inserting 10000 records into 'sbtest6'
Creating a secondary index on 'sbtest6'...
Creating table 'sbtest7'...
Inserting 10000 records into 'sbtest7'
Creating a secondary index on 'sbtest7'...
Creating table 'sbtest8'...
Inserting 10000 records into 'sbtest8'
Creating a secondary index on 'sbtest8'...
Table "public.sbtest1"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest1_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest1_pkey" PRIMARY KEY, btree (id)
"k_1" btree (k)
Table "public.sbtest2"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest2_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest2_pkey" PRIMARY KEY, btree (id)
"k_2" btree (k)
Table "public.sbtest3"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest3_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest3_pkey" PRIMARY KEY, btree (id)
"k_3" btree (k)
Table "public.sbtest4"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest4_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest4_pkey" PRIMARY KEY, btree (id)
"k_4" btree (k)
Table "public.sbtest5"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest5_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest5_pkey" PRIMARY KEY, btree (id)
"k_5" btree (k)
Table "public.sbtest6"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest6_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest6_pkey" PRIMARY KEY, btree (id)
"k_6" btree (k)
Table "public.sbtest7"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest7_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest7_pkey" PRIMARY KEY, btree (id)
"k_7" btree (k)
Table "public.sbtest8"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest8_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest8_pkey" PRIMARY KEY, btree (id)
"k_8" btree (k)
Did not find any relation named "sbtest9".
sysbench *.* * (glob)
FATAL: *: prewarm is currently MySQL only (glob)
sysbench *.* * (glob)
Running the test with following options:
Number of threads: 2
Initializing random number generator from current time
Initializing worker threads...
Threads started!
SQL statistics:
queries performed:
read: 0
write: * (glob)
other: * (glob)
total: 100
transactions: 100 (* per sec.) (glob)
queries: 100 (* per sec.) (glob)
ignored errors: 0 (* per sec.) (glob)
reconnects: 0 (* per sec.) (glob)
General statistics:
total time: *s (glob)
total number of events: 100
Latency (ms):
min: *.* (glob)
avg: *.* (glob)
max: *.* (glob)
95th percentile: *.* (glob)
sum: *.* (glob)
Threads fairness:
events (avg/stddev): */* (glob)
execution time (avg/stddev): */* (glob)
sysbench *.* * (glob)
Dropping table 'sbtest1'...
Dropping table 'sbtest2'...
Dropping table 'sbtest3'...
Dropping table 'sbtest4'...
Dropping table 'sbtest5'...
Dropping table 'sbtest6'...
Dropping table 'sbtest7'...
Dropping table 'sbtest8'...
Did not find any relation named "sbtest1".
Did not find any relation named "sbtest2".
Did not find any relation named "sbtest3".
Did not find any relation named "sbtest4".
Did not find any relation named "sbtest5".
Did not find any relation named "sbtest6".
Did not find any relation named "sbtest7".
Did not find any relation named "sbtest8".
# Test --create-secondary=off
sysbench * (glob)
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Table "public.sbtest1"
Column | Type | Modifiers | Storage | Stats target | Description
--------+----------------+------------------------------------------------------+----------+--------------+-------------
id | integer | not null default nextval('sbtest1_id_seq'::regclass) | plain | |
k | integer | not null default 0 | plain | |
c | character(120) | not null default ''::bpchar | extended | |
pad | character(60) | not null default ''::bpchar | extended | |
Indexes:
"sbtest1_pkey" PRIMARY KEY, btree (id)
sysbench * (glob)
Dropping table 'sbtest1'...
# Test --auto-inc=off
Creating table 'sbtest1'...
Inserting 10000 records into 'sbtest1'
Creating a secondary index on 'sbtest1'...
Dropping table 'sbtest1'...

View File

@ -1,5 +1,5 @@
########################################################################
oltp_point_select.lua + MySQL tests
oltp_insert.lua + MySQL tests
########################################################################
$ . $SBTEST_INCDIR/mysql_common.sh

View File

@ -1,5 +1,5 @@
########################################################################
oltp_point_select.lua + PostgreSQL tests
oltp_insert.lua + PostgreSQL tests
########################################################################
$ . $SBTEST_INCDIR/pgsql_common.sh