Skip to content

Commit

Permalink
select_random_ranges: mysql mrr for secondary_ranges == 2
Browse files Browse the repository at this point in the history
old complex query does not use mrr
  • Loading branch information
rockeet committed Nov 1, 2023
1 parent 0f10d07 commit 18ff66e
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/lua/select_random_ranges.lua
Original file line number Diff line number Diff line change
Expand Up @@ -48,9 +48,9 @@ function thread_init()
-- MySQL doesn't yet support 'LIMIT & IN/ALL/ANY/SOME subquery,
-- So we create an extra nested subquery
stmt = con:prepare(string.format([[
SELECT count(*), sum(length(c)) FROM sbtest1 WHERE id IN
(SELECT * FROM (SELECT id FROM sbtest1 WHERE %s LIMIT %d) as t)]],
ranges, sysbench.opt.range_size))
SELECT length(c)
FROM sbtest1
WHERE %s LIMIT %d]], ranges, sysbench.opt.range_size))
else
stmt = con:prepare(string.format([[
SELECT sum(length(c))
Expand Down

0 comments on commit 18ff66e

Please sign in to comment.