Background
Im working on some kind of data logger.
I want to try how much storage space I need for 1000000 (1M) rows and how Raspberry Pi deals with such big table. I want to run some queries with grouping, calculating averages and other performance experiments.
My table looks like this:
CREATE TABLE `data`
(
`id` bigint(20) NOT NULL AUTO_INCREMENT,
`datetime` timestamp NULL DEFAULT CURRENT_TIMESTAMP,
`channel` int(11) DEFAULT NULL,
`value` float DEFAULT NULL,
PRIMARY KEY (`id`)
)
Question
How can I fill it with 1000000 million rows in MySQL?
Requirements:
data.datetime
field: random timestamps but only from one yeardata.value
field: random float numbers from given range (0.00-100.00 for example)data.id
is autoincrement, no need to care about thatdata.channel
is always 1, no need to care about that too
I know SQL a bit, but I'm not good in PL/SQL, loops in SQL etc.
EDIT:
To make it clear - im using MySQL 5.5.
Mentioned PL/SQL was my mistake, I thought PL/ stands for procedural features in SQL in general, not just Oracle.