what difference between cursor and all in laravel

Published 7 months ago by thesogafoi

my question in clear i think :D

Best Answer (As Selected By thesogafoi)
tisuchi

all() and cursor are two different things.

Normally cursor method use for reduce memory usage during fetching large amount of data.

On the other hand, all method use for fetching all the data from a particular table.

You can compare cursor and chunk.

Check this discussion: https://stackoverflow.com/questions/45467100/optimizing-code-with-chunk-or-cursor-in-laravel

tisuchi
tisuchi
7 months ago (305,085 XP)

all() and cursor are two different things.

Normally cursor method use for reduce memory usage during fetching large amount of data.

On the other hand, all method use for fetching all the data from a particular table.

You can compare cursor and chunk.

Check this discussion: https://stackoverflow.com/questions/45467100/optimizing-code-with-chunk-or-cursor-in-laravel

thesogafoi

thx man @tisuchi

Please sign in or create an account to participate in this conversation.