Created
November 11, 2019 18:20
-
-
Save xeoncross/2ca4220a321ec81a514ba634932be8f5 to your computer and use it in GitHub Desktop.
Example of writing a MariaDB query to generate 100k records
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- See more at https://stackoverflow.com/a/49446214/99923 | |
INSERT INTO T1 (id, created_on, domain, seen_on) | |
SELECT one.X, two.X, three.X, two.X | |
FROM (select seq, seq X from seq_1_to_100000) one | |
LEFT JOIN (select seq, NOW() - INTERVAL seq MINUTE X from seq_1_to_100000) two ON one.seq = two.seq | |
LEFT JOIN (select seq, CONCAT(seq,'.',seq) X from seq_1_to_100000) three ON one.seq = three.seq; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment