How to Generate 10 MILLION Sample Rows in SQL

preview_player
Показать описание

If you need to generate a lot of random data in SQL, don't use a spreadsheet. You can use SQL directly.

In this video, you'll learn:
- several methods to generate a random set of rows
- how to do it in Oracle, SQL Server, MySQL, and PostgreSQL
- how each method performs at different volumes of data, all the way up to generating 10 million rows.

⏱ TIMESTAMPS:
00:00 - Oracle
08:56 - SQL Server
14:46 - MySQL
19:18 - PostgreSQL

🔗 VIDEO LINKS:
Рекомендации по теме
Комментарии
Автор

Great Video! It would nice if you could publish the execution plans for each step, so we could see where the differences are for each step. As Tom Kyte used to say - "Row by row, is slow slow slow." 😁 Did you try using the BULK COLLECT FORALL technique in Oracle?

jjJohnson-tx
Автор

it might be worth making a logarithmic plot for the runtimes because they differ so much like 20 seconds for SQL Server and 6900 seconds for MySQL for 10 million rows. it makes it harder to compare relatively small values when you plot really large values. log(10 million runtime).

walkingradiance
Автор

could you use a sequence object in Oracle similar to the generate series in Postgres?

walkingradiance
Автор

Great video! You always do fair tests :) I wonder if you have seen MySQL 8 has been performing worse than MySQL 5.7 in some tests. Which MySQL version did you test with?

natenatters
Автор

you could generate a random real and convert it from absolute time to date for random date function.

walkingradiance
Автор

I installed Oracle 21c enterprise server-class directly on Windows. Do you mean Oracle 23 ai can only be installed on Windows with Docker?

walkingradiance
Автор

Plz make a video on Postgre Vs MySQL Vs MSSQL, Which SQL database to choose?

mrmoiz