On a site with many fields (I have a production site with 542 fields!) use of views_fetch_data() without $table is very slow, even when using memcache. (well, very slow in general without #1421844: views_fetch_data() cache item can reach over 10mb in size.)

To avoid the overhead, entity should be caching the base table list it computes.

Using views caching to store the base table list should allow caching while still being refreshed as needed.

See also #1421844: views_fetch_data() cache item can reach over 10mb in size for the views side of the performance equation on large sites.

Patch coming in a moment.

CommentFileSizeAuthor
#1 1558340-cache-base-table-list.patch1.32 KBbdragon

Comments

bdragon’s picture

Status: Active » Needs review
StatusFileSize
new1.32 KB

And the patch.

fago’s picture

Status: Needs review » Postponed (maintainer needs more info)

Is hook_views_plugins() invoked often? If so, I think that patch makes a lot of sense. (I ran into this memory issue already too).

If it's just invoked on cache-build it shouldn't matter though - I guess you have investigated that?

bdragon’s picture

Status: Postponed (maintainer needs more info) » Needs review

It was every page load on a views page for me. It might be something that only happens when using views from code though, views does certain sanity checks for those that it might skip for views from database....

fago’s picture

Status: Needs review » Fixed

I see, it seems to be a static cache only. So it makes a lot of sense - thanks for catching it. Committed.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.