Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to figure out how to increment a number in a mysqlslap query with every iteratiom.

Let me explain what I exactly mean:

I got a query:

SELECT age FROM member WHERE id = [some number] 

is there a way to write mysqlslap parameter, so it iterates the [some number] while executing the query multiple time ? I do not want to keep doing the same query, as it caches.

I went through the documentation on but did not really find the straight answer to my question.

If there is not mysqlslap solution, maybe there is a way to achieve this with some other tool.

Cheers for help !

share|improve this question
when you say " I do not want to keep doing the same query, as it caches.", are you just concerned with the performance disregarding the query cache? – Derek Downey Oct 15 '12 at 15:30

If you are worried about the performance effect of caching the result in the query cache, you can disable caching in your query by using SQL_NO_CACHE:

SELECT SQL_NO_CACHE age FROM member WHERE id = [some number]
share|improve this answer

I would consider the random function.

For instance:

select age 
from member 
where id = FLOOR(RAND()*10000)) 

In this example, 10000 is the maximum id value present in the table.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.