Bug #48462 mysqlslap using dynamical data for load generation
Submitted: 2 Nov 2009 10:59
Reporter: Oli Sennhauser Email Updates:
Status: Verified Impact on me:
None 
Category:Tools Severity:S4 (Feature request)
Version:any OS:Any
Assigned to: CPU Architecture:Any
Tags: data.load, dynamical, generation, mysqlslap

[2 Nov 2009 10:59] Oli Sennhauser
Description:
Customer would like to have mysqlslap using dynamicaly predefined data like supersmack does.

How to repeat:
n.a.

Suggested fix:
The only concern at the moment with mysqlslap was related to the impossibility of dynamically feed the query I had.

Supersmack do that with something called a dictionnary :

(extract from the MANUAL)
---
dictionary object has the following members/attributes:

type "rand"/"seq"/"unique" :
"rand" - the dictionary is initialized with a list of words, and they are
retrieved in random order
"seq" - the words are retrieved in the sequential order
"unique" - each word is generated by snprintf(buf, buf_size, template, id),
and id is incremented by 1

source_type "file"/"list"/"template" -
should the dictionary be initialized from a file,
a user-defined list, or using a template?

source - if the source type is file, tells us which file the dictionary is in,
if list, provided a comma-delimited list of entries, if the source is a
template, use it as a sprintf() format template.
---

So perhaps mysqlslap could add an extra parameter, let's say 'dico' :

mysqlslap -uuser_agadal -p -vvv --dico=dico.csv --concurrency=1 --iterations=1 --query="udpate mytable set field1=$1, field2=$2"

with $1 which could be the first value in my dico.csv file, $2 the 2nd...
(dico.csv )
---
2;3;
1;2;
4;5;
[...]
---

I don't know the best way to do it but that's the idea.
I know now how to use concat + mysqlslap to do the same thing but I'd appreciate to do that in only one tool.
Perhaps we can add the possibility to retrieve the $1, $2 from a query and not from a file, that's the last idea you proposed.