I want to create simple program that is going to populate MySQL database tables with some random values 10 000 times. I want to test the speed of inserting and reading in tables with two engines InnoDB (it’s standard row oriented engine) and InfiniDB (specified column oriented engine). Any idea how to do this?
This is the example of one of the tables in my database:
CREATE TABLE IF NOT EXISTS `mydb`.`tblVariable` (
`idtblVariable` INT NOT NULL ,
`name` VARCHAR(20) NULL ,
`station_id` INT NULL ,
`description` VARCHAR(100) NULL ,
`id_history` INT NOT NULL DEFAULT 0 ,
`type` ENUM('Analog','Digital') NOT NULL
)
so to explain..for idtblVariable that’s going to be number from 1 to 10 000 random
name can be: PT1,…, PT10000
description for example is going to be just: a,a,a,a, 10 000 times
etc.
Client side is program, the inserting and reading is in C# with forms, classic application. Can this could be done in batch program???
Here is a nother trick for populating numbers from 1 to 10000. If you create a temp table or a table variable and fill it with numbers from 0 to 9 like so:
Then you can generate numbers from 1 to 10000 like so:
SQL Fiddle demo