曾就职于阿里巴巴担任Oracle DBA,MySQL DBA,目前在新美大担任SRE。[是普罗米修斯还是一块石头,你自己选择!] 欢迎关注微信公众号 “自己的设计师”,不定期有原创运维文章推送。
分类: Mysql/postgreSQL
2013-12-26 18:17:13
In this mode each thread runs simple queries of the following form:
SELECT c FROM sbtest WHERE id=N
|
where N takes a random value in range 1..
Each thread performs transactions on the test table. If the test table and database support transactions (e.g. InnoDB engine in MySQL), then BEGIN/COMMIT zxszcaijin2015-06-17 00:43:34 思学而进:请教楼主关于sysbench执行查询语句这一块: 按理来讲,应该是具体的值,请给我当时的截图。
对于简单的类型,用SELECT c FROM sbtest WHERE id=N,N在1..table_size 进行查询即可
statements will be used to start/stop a transaction. Otherwise, SysBench will use LOCK TABLES/UNLOCK TABLES statements (e.g. for MyISAM engine in MySQL).
If some rows are deleted in a transaction, the same rows will be inserted within the same transaction, so this test mode does not destruct any data in the test table
and can be run multiple times on the same table.
SELECT c FROM sbtest WHERE id=N
SELECT c FROM sbtest WHERE id BETWEEN N AND M
SELECT SUM(K) FROM sbtest WHERE id BETWEEN N and M
SELECT c FROM sbtest WHERE id between N and M ORDER BY c
SELECT DISTINCT c FROM sbtest WHERE id BETWEEN N and M ORDER BY c
UPDATE sbtest SET k=k+1 WHERE id=N
UPDATE sbtest SET c=N WHERE id=M
DELETE FROM sbtest WHERE id=N
INSERT INTO sbtest VALUES (...)
当然,我们还可以对源码表结构的创建来进行更改,从而更加符合真实的场景。
--EOF--
祝玩的开心
snprintf(query, MAX_QUERY_LEN, "SELECT c from %s where id=?",args.table_name);
set->point = db_prepare(conn, query);
查询的语句是"SELECT c from %s where id=?" 我以为会是N,但是我从processlist看到的查询条件还是"?".
请教一下程序是怎么查询条件由?变成N的呢?
谢谢