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

КОМЕНТАРІ • 48

  • @Laratips
    @Laratips  Рік тому

    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

  • @Laratips
    @Laratips  3 роки тому +14

    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.

  • @BraderGeoYT
    @BraderGeoYT 4 місяці тому

    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!

  • @VitorJustin
    @VitorJustin 3 роки тому +3

    Great tip! Tks for sharing!

  • @musicfactoryPH
    @musicfactoryPH 2 роки тому +1

    Very big help. Thank you so much

  •  3 роки тому +1

    great leson

  • @imranlashari6578
    @imranlashari6578 5 місяців тому

    @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

  • @OnlinePseudonym
    @OnlinePseudonym Рік тому +1

    Really insightful - thanks very much 🙂

  • @vmmismagic
    @vmmismagic 5 місяців тому

    amazing explanation!

  • @alnahian2003
    @alnahian2003 Рік тому

    Cool! Learned something new and helpful.

  • @johnp6115
    @johnp6115 2 роки тому

    Thanks for the tip, awesome!

  • @mirshodmustafoyev2524
    @mirshodmustafoyev2524 Рік тому

    What happens if we use second query for non indexed data ? Gets less time than 4s or not ?

  • @nathanstanfordsr
    @nathanstanfordsr Рік тому

    awesome tip thanks

  • @sri3235
    @sri3235 Рік тому

    Thank you

  • @bhavyakumarpanchotiya8254
    @bhavyakumarpanchotiya8254 3 роки тому +2

    What is use of Carbon ...make the video on that..

    • @Laratips
      @Laratips  3 роки тому +1

      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. :)

    • @bhavyakumarpanchotiya8254
      @bhavyakumarpanchotiya8254 3 роки тому +2

      @@Laratips Thank you sir

  • @farhanisrak8688
    @farhanisrak8688 6 місяців тому

    Can you please tell which extension you're using for checking those queries?

  • @ramonm8039
    @ramonm8039 3 роки тому +3

    What is the name of the tool to see Queries??

  • @diomandesouleymane6621
    @diomandesouleymane6621 3 роки тому

    Great tip

  • @shahriyarhosseinzadeh4409
    @shahriyarhosseinzadeh4409 Рік тому +1

    Hey , please turn on subtitle

  • @fahathamm3965
    @fahathamm3965 3 роки тому

    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

    • @Laratips
      @Laratips  3 роки тому +2

      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. ♥️

  • @taskinurrahman6650
    @taskinurrahman6650 Рік тому +6

    Use count(id) instead of count(*)

    • @impostor8984
      @impostor8984 Рік тому

      no

    • @Xaero324
      @Xaero324 11 місяців тому +2

      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(*)

  • @lchig0
    @lchig0 2 роки тому

    Great vid buddy

  • @MikdanJey
    @MikdanJey Рік тому

    Great

  • @LukePighetti
    @LukePighetti Рік тому

    What tool are you using to show the Laravel query performance?

    • @Laratips
      @Laratips  Рік тому

      It's a laravel package called Laravel Debugbar

  • @Vikaskumar-ur5di
    @Vikaskumar-ur5di Рік тому

    which package are used in laravel debug

  • @BijayaNamna
    @BijayaNamna Рік тому

    Are you from Nepal ?
    You accent seems like that

  • @kapadiajanak
    @kapadiajanak 3 роки тому

    Laravel socket io lesson

  • @tusharnain6652
    @tusharnain6652 9 місяців тому

    But it's gonna cost WRITE Operations.

    • @jlbciriaco3142
      @jlbciriaco3142 8 місяців тому

      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.

  • @hizkielputra1195
    @hizkielputra1195 Рік тому

    thank you

  • @MudassarYaseen
    @MudassarYaseen 2 роки тому

    Great