I Tried to Query 10 MILLION Rows in MySQL in 3 Seconds

Published: 27 August 2024
on channel: Database Star
2,199
118

📝 Get my free SQL Cheat Sheets: https://www.databasestar.com/get-sql-...
🎓 Master SQL Fundamentals: https://databasestar.mykajabi.com/sql...

I've got a query I want to run on about 10 million rows of data in MySQL. It's slow and I want to get it to run in under 3 seconds.

In this video, I'll show you the query, the current run time, and all the steps I take to try to get it to run in under 3 seconds.


⏱ TIMESTAMPS:
00:00 - The data set
03:33 - The query
05:49 - Add indexes
07:25 - Adjust subquery
08:39 - Another table
11:56 - Joins
15:09 - Adjust table
16:20 - Another approach
18:11 - Ask a question
21:41 - What we learned


🔗 VIDEO LINKS:
SQL code for this video: https://github.com/bbrumm/databasesta...

COMMANDS:
Replace backslashes:
sed -i "" 's/\\/ /g' reviews_10m.csv


Watch video I Tried to Query 10 MILLION Rows in MySQL in 3 Seconds online without registration, duration hours minute second in high quality. This video was added by user Database Star 27 August 2024, don't forget to share it with your friends and acquaintances, it has been viewed on our site 2,199 once and liked it 118 people.