Skip to content

Commit 18ff66e

Browse files
committed
select_random_ranges: mysql mrr for secondary_ranges == 2
old complex query does not use mrr
1 parent 0f10d07 commit 18ff66e

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

src/lua/select_random_ranges.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ function thread_init()
4848
-- MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery,
4949
-- So we create an extra nested subquery
5050
stmt = con:prepare(string.format([[
51-
SELECT count(*), sum(length(c)) FROM sbtest1 WHERE id IN
52-
(SELECT * FROM (SELECT id FROM sbtest1 WHERE %s LIMIT %d) as t)]],
53-
ranges, sysbench.opt.range_size))
51+
SELECT length(c)
52+
FROM sbtest1
53+
WHERE %s LIMIT %d]], ranges, sysbench.opt.range_size))
5454
else
5555
stmt = con:prepare(string.format([[
5656
SELECT sum(length(c))

0 commit comments

Comments
 (0)