fast-excel icon indicating copy to clipboard operation
fast-excel copied to clipboard

Fastexcel exporting only around 60k in production

Open p1xel007 opened this issue 2 years ago • 5 comments

I'm trying to export from DB around 300k rows.

In local it works fine but in production server, it only exports around 60k.

PHP 8.0.15 Laravel 8

p1xel007 avatar Mar 21 '22 18:03 p1xel007

I did some further testing.

It looks like when I select more than 5 columns I start to get reduced rows in the export.

It's only happening in productuction server not in local.

I have MYSQL 8 in server but MYSQL 5.7 in local. Could that be the reason?

p1xel007 avatar Mar 21 '22 22:03 p1xel007

Update: I tried with Mysql 8 same version as the server in local (windows 10).

And it still works fine on local.

It's really strange. What could be the issue?

p1xel007 avatar Mar 21 '22 23:03 p1xel007

Update: I followed @rap2hpoutre 's tutorial for the cursor method to export from collection.

When I try with cursor, I get this problem.

However, but when I try with lazy() function instead of cursor, I don't see this problem.

Is cursor() function the culprit here?

p1xel007 avatar Mar 22 '22 17:03 p1xel007

Hi!!

Ia have use cursor to generate 1millon of rows and run perfect.

I have this code:

foreach($data->cursor() as $lead) { yield $lead->setAppends([]); }

$data is a builder or 1millon of rows. Dont do get or somethind, create builder, and pass to the forearch with cursor. The use yield.

In 51second, using dowload method, i have a csv with 1millon of rows in mi dowload folder.

gabrielchiron avatar Apr 25 '22 09:04 gabrielchiron

Hi!!

Ia have use cursor to generate 1millon of rows and run perfect.

I have this code:

foreach($data->cursor() as $lead) { yield $lead->setAppends([]); }

$data is a builder or 1millon of rows. Dont do get or somethind, create builder, and pass to the forearch with cursor. The use yield.

In 51second, using dowload method, i have a csv with 1millon of rows in mi dowload folder.

Hi, thanks for your reply.

With cursor I couldn't get all the rows to be exported for some reason. But in your code, I see you added "setAppends". Is this a vital part that will fix this issue?

p1xel007 avatar Apr 25 '22 10:04 p1xel007