#17254Multiple retrieval of all table rows
Description
Here is my situation:
I have records containing “inline” field (A) which displays children containing inline element (B). Typical record contains A field with 10 children each of them having B element with 10 children displayed. It is only 100 simple records but rendering process takes up to 20 sec. Plus I had to uprise memory_limit up to 128Mb!
Looking onto the sources I noticed that when inline fields children are rendered, ALL of table’s records are retrieved into memory and records titles are processed. This happens even if there no children to render.
So in my case, table A contains 68 rows, table B – 892.
If field B is empty – 68 records are retrieved and processed.
If field B has 10 children then 68 A records + 10 * 892 B records are retrieved and processed. If children’s titles are rendered by user function then this function is called 9000 times. If it resides in non persistent user object then object is created 9000 times and so on…
Would it be possible to retrieve only records that are actually needed. I had no time to dig deeper into core on this matter. If there is greater reason for retrieving all record, maybe they could be at least cached to prevent multiple retrieval during one form rendering?
Thank you!
(issue imported from #M5511)
Reviews 0
No change resolves or names this issue in its commit message, and no comment links one.