#5: Database Chunking | 🚀 Quick Laravel Performance Tips 🚀

Поделиться
HTML-код
  • Опубликовано: 1 окт 2024
  • If you need to process a big database query, Then you must use the chunk method. This chunk method will fetch a "chunk" of the Eloquent collection. Using the chunk method will reduce memory usage when working with large result sets.
    🚀 𝗤𝘂𝗶𝗰𝗸 𝗟𝗮𝗿𝗮𝘃𝗲𝗹 𝗣𝗲𝗿𝗳𝗼𝗿𝗺𝗮𝗻𝗰𝗲 𝗧𝗶𝗽𝘀 𝗣𝗹𝗮𝘆𝗹𝗶𝘀𝘁:
    • 🚀 Quick Laravel Perfor...

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

  • @QiroLab
    @QiroLab  4 месяца назад

    *Don't get left behind! Try Spec Coder: Supercharge Your Coding with AI!*
    👉 qirolab.com/spec-coder

  • @vivekshingala1431
    @vivekshingala1431 4 года назад +2

    Hi QiroLab, how to solve max_execution_time and memory_limit issue together? When I try to chunk the collection, it goes timeout for me.

  • @AbdelElrafa
    @AbdelElrafa 5 лет назад +3

    QiroLab what are you using to see your queries on the Chrome dev tools?

    • @QiroLab
      @QiroLab  5 лет назад +1

      I have installed the Laravel Debugbar package. Here in this video you can see how I installed this package in Laravel Project.
      ruclips.net/video/N0phQbyzF0I/видео.html

    • @randyharsh3046
      @randyharsh3046 5 лет назад +1

      thanks

    • @QiroLab
      @QiroLab  5 лет назад

      @@randyharsh3046 You’re welcome.

  • @vitalii3256
    @vitalii3256 5 лет назад +1

    Yes, but who ever will show 100000 entities on a single page? I think Laravel paginate() method solves this problem.

    • @razet3377
      @razet3377 5 лет назад +4

      Yes, you are right. No, one will show 100000 records on a single page. But there are much other use cases where you may need to fetch 100000 records. For example, you may need for report generating like analytics, or to update each record for some reason, or you may need to send a notification to 100000 users or you may need to clean up some records based on some conditions. There are many many use cases where you may need to fetch 100000 records.

  • @RajYadav-zo4en
    @RajYadav-zo4en 2 года назад

    Hi, I have questions regarding laravel query,
    I have a open profile search platform with all of this field-
    No of records you want - required
    Job title - optional
    City - optional
    State - optional
    Country - optional
    1. First time I have searched 25000 records
    2. Second time same 25000 records
    and so on or may be different number with different fields
    Note: I need unique records on every search that's by I am creating and history table for this with comma separated profile ids but it's failed when I will reach 100000 previous search records eliminate from profile table. One another thing I am using previous records eliminate using where not in..
    Do you have any solution for this?

  • @jackodhiambo5710
    @jackodhiambo5710 Год назад

    what if you wanted to use pagination with chuck all together

  • @bobpps
    @bobpps 5 лет назад +1

    Еще раз большое спасибо за Ваши классные уроки!

  • @botakensem
    @botakensem 3 года назад

    good explanation

  • @Dipenparmar12
    @Dipenparmar12 4 года назад

    This helps a lot... Thanks