Drastically Improve Query Time From 4 seconds to 70 milliseconds (50 - 60 times faster)
Вставка
- Опубліковано 7 вер 2024
- In this video, we will learn how to MySQL indexing to increase the performance of our application. By adding an index to a column you can drastically improve the query time of your application.
=== Important Links ===
Fonts, extensions I use, and Support Laratips links:
bit.ly/m/laratips
=== Offer ===
Laravel Hosting: platform.cloud...
Get up to Free Hosting by using code "LARATIPS" and you get $15 as credit which can last almost a month.
Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr
====================== Support ======================
If you want me to continue making this kind of video for free on UA-cam, then you can support the channel
eSewa ID: 9843632084
Wise Link: bit.ly/3dnBRmX
Wise email: ashish.dhamala2015@gmail.com
===
Let's be friends:
/ aashish_dhamala
Tech stack:
Laravel
PHP
MySQL
#laravel #php #mysql
Get $15 credit by using code "LARATIPS" which can last almost a month.
Cloudways Web Hosting: platform.cloudways.com/signup?id=1029148&data1=bw&coupon=LARATIPS
Cloudways offers peace of mind and flexibility so you can focus on growing your business and reaching new milestones instead of dealing with server management. With Cloudways, you get an optimized stack, managed servers, backups, staging environment, integrated Git, pre-configured, Composer, 24/7 support, and the choice of five cloud providers: AWS, DigitalOcean, Linode, Google Cloud, and Vultr
Hey Guys, just wanted to share that don't go and create many indexes in your application. There is one downside of it as well. Yes, it increases the read performance of your application but it will decrease the write performance. It means when you store something in the table with lots of indexes, it will take a lot of time to actually store the data in the table.
So, if your application does more reads than writes, you can add more indexes but the lesser the indexes better it is. Also, always check the performance of your application and roll back if necessary after adding an index.
I'm applying as a Laravel Developer for my next job and this really helped me alot to prepare and this is very useful thanks for the tip!
Great tip! Tks for sharing!
Very big help. Thank you so much
You're welcome!
great leson
Thanks
@laratips what about if i am using vue js as frontend and laravel as backend, i need to check every API call query execution time to optimize it
Really insightful - thanks very much 🙂
Glad it was helpful!
amazing explanation!
Cool! Learned something new and helpful.
Glad it was helpful!
Thanks for the tip, awesome!
What happens if we use second query for non indexed data ? Gets less time than 4s or not ?
awesome tip thanks
Thank you
What is use of Carbon ...make the video on that..
It is basically a wrapper around PHP's DateTime class but much more readable api. Sure I will make one. Thanks for the video idea. :)
@@Laratips Thank you sir
Can you please tell which extension you're using for checking those queries?
using laravel debug bar
Thanks @@fatchurrosi4386
What is the name of the tool to see Queries??
Laravel debugbar
@@julienSibille Thanks!
Great tip
Hey , please turn on subtitle
Can i use collection for cout... if i use collect how much kuch sec take it.. which one is better..? Thank you recent addict laravel channel one of the subscriber
Always use eloquent or database layer instead of collection if possible. The time taken depends on how many data u have in collection. You can check the time by logging the time before and after the collection execution.
Thanks for subscribing. ♥️
Use count(id) instead of count(*)
no
This has been debunked. That may have been true very long ago, however, DBMS are now optimized and would prefer you use count(*). In short: count(*) !== select(*)
Great vid buddy
Thanks
Great
What tool are you using to show the Laravel query performance?
It's a laravel package called Laravel Debugbar
which package are used in laravel debug
Laravel debugbar
Are you from Nepal ?
You accent seems like that
Yes
Laravel socket io lesson
But it's gonna cost WRITE Operations.
just think about what the user will do more: it will update the data or just see the data? generally is more acceptable a slow write operation than a slow read operation.
thank you
Great