LaravelDaily/laravel-charts

Optimization

Opened this issue · 4 comments

Hello,
is there a way to optimize queries from this package?

Right now the query is "select * from table" and I guess that is not good because if someone is using this for bigger projects where there might be 10k users the application will use 50MB of ram and there will also be 10k models loaded and wait time will be about 3-5s.

We just need numbers of rows related to "created_at" or something like that we don't need all columns.

@SeadSilajdzic valid point, it's probably worth improving, but we don't actually know what fields we need, in some cases it's created_at, in other cases it's other fields, as there are a lot of grouping parameters.

So it's not an easy task to select the fields. But if you want to contribute, we would happily accept a Pull Request.

Good point, but I guess 90% of people will work with dates. Will try to make it work for me and if I succeed I will contribute :)

What about have the ability to configure (based on time remembered) and cache generated result on dataset prepareData() method

@keatliang2005 same answer as above: if you want to contribute with your suggestion as a Pull Request, I'm happy to review.