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

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

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:

COMMANDS:
Replace backslashes:
Рекомендации по теме
Комментарии
Автор

You did a great justice on this topic. I'm so impressed at how you made a daunting task seem easy. You're simply the best.

christopherokonkwo
Автор

Excellent! I really like how you brought in the stakeholders and provided them with options each with their pros and cons. And thank you for warning people about when DISTINCT is acceptable and when not. Too often I've seen inexperienced people find they're getting back duplicates and just throw in DISTINCT without actually taking the time to figure out where the duplicates are coming from.

JeffreyCogswell
Автор

That was amazing... your explanations are clear and concise. Talent and ability to communicate, makes you a great mentor.

MaikolHernandez-kvvl
Автор

I've been looking for this long. You are the best!

pattana_pu
Автор

Wow this is helpful. Please bring more of these. Thank you

jitxhere
Автор

Great example of how just creating indexes doesn't always works. I just learned about indexing today and thought they were an all powerful tool. Glad that I found your video! Thanks

prashastjaipurkar
Автор

Wow, what an excellent video, I would personally say one of your best and seriously informative 👍👍👍

PeteSimpson
Автор

Can you make the same for Postgresql? with 100 Million rows?

forbidden_lion