Summaries directly from the table query result, instead of additional queries (slowing the page down) #14132
Jacotheron
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I have a very large table (~450 rows), which is built using joins, and exists queries from about 10 tables in the db. This table also need to display all records at once (spec requirement), thus this table takes a while to load. This table makes use of Grouping and Summaries - thus for each summary, it runs a whole bunch of queries (~250 queries total according to debugbar). This all slows the page down by a lot (luckily it is only a couple of people with access to these pages - there are 5 similar pages), but it is wasting time.
My table query already have all of the information needed for the summaries, so logically being able to access the table query result, and either looping or using Laravel's Collection methods on it, would get me the results a lot quicker (its already fetched from the db, in memory). And for grouped tables, simply getting the group collection would also help a lot.
I propose a new method for the summaries which disables the query part, where a callable function can be provided which will receive either the whole table's data as collection, or the current group's data as collection, and expecting to return the summary value.
Beta Was this translation helpful? Give feedback.
All reactions