Optimize Laravel Queries & Reduce Memory Usage for Faster Performance | Laravel Query Optimization

Поделиться
HTML-код
  • Опубликовано: 4 ноя 2024

Комментарии • 13

  • @HafizurRahman-g4w
    @HafizurRahman-g4w 10 дней назад

    Awesome explain. Thanks. We want more video on query optimization

  • @seppdaniel
    @seppdaniel Год назад +11

    You should not COUNT('id'), but rather COUNT('*') and thus let database decide which column is fastest to count.

    • @laravelschool
      @laravelschool  Год назад +3

      I totally agree. It's a good point @seppdaniel BTW.
      However the performance difference between `COUNT('id')` and `COUNT(*)` is negligible, especially when 'id' is the primary key and non-NULL values.

  • @tanzimibthesam5861
    @tanzimibthesam5861 Год назад +4

    Awesome btw do you intend to cover database indexing in any future videos n how to implement it in Laravel

    • @laravelschool
      @laravelschool  Год назад +1

      Thank you for your comment.
      Creating *index* is straight forward. Therefore I didn't cover it here. FYI: laravel.com/docs/10.x/migrations#creating-indexes
      I have plan to cover it to other video in different context, not for this scenario.

  • @markbarton6845
    @markbarton6845 9 месяцев назад

    Thanks for this great example of refactoring problem queries. I’d love to see an example of the database indexing you mentioned as this is not something many people seem to demonstrate.

    • @laravelschool
      @laravelschool  8 месяцев назад

      Thanks for your comment. I will consider to create another video for that.

  • @KishanKumar-jp7ee
    @KishanKumar-jp7ee 4 месяца назад

    We want more video on query optimization

  • @programmertelo
    @programmertelo 5 месяцев назад

    amazing stuff

  • @WebWordsWave
    @WebWordsWave 6 месяцев назад

    which theme and font?

  • @aizazaziz5636
    @aizazaziz5636 3 месяца назад +1

    Hi, Please share source code for this

  • @kinvain
    @kinvain Год назад +1

    YAN1FT = Yet Another N+1 Fixing Tutorial.