Answer the question
In order to leave comments, you need to log in
How to create a lot of data for testing?
Good evening, at
once about the main thing...
I have 3 connected tables where there are 30 lines of the valid data.
I need to multiply this related data to eg 500,000 rows for testing purposes.
I do a greedy load and then insert insert - it goes out for 17 hours) Tell me, maybe there is a faster way.
Thank you.
Answer the question
In order to leave comments, you need to log in
It's best to use branchInsert and populate the database in an instant)
Disable keys before multiple inserts.
After you turn it on.
dev.mysql.com/doc/refman/5.7/en/alter-table.html
And for data generation I recommend Faker
use the points described in the article, the link to which was given by un1t,
but I would like to add that you can move the data generation outside of php to the database level, this will also save time due to the lack of data exchange between php and the database. For example, move the generation to a stored procedure:
CREATE PROCEDURE `make_data`()
BEGIN
DECLARE i INT DEFAULT 1;
WHILE i < 500000 DO
<тут INSERT запрос>
SET i = i + 1;
END WHILE;
END
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question