The query for
SELECT cid, data, created, expire, serialized FROM cache_views WHERE cid IN ('views_data:en')

is taking 250ms on my production site because the BLOB is 550kb and apparently I can't do anything about it other than cache it?

Even on a page with only a node display it's running this query and this one (100ms):

SELECT cid, data, created, expire, serialized FROM cache_views WHERE cid IN ('ctools_export:views_view:comments_recent', 'ctools_export:views_view:tracker', 'ctools_export:views_view:friends', 'ctools_export:views_view:archive', 'ctools_export:views_view:frontpage', 'ctools_export:views_view:glossary', 'ctools_export:views_view:backlinks', 'ctools_export:views_view:popular', 'ctools_export:views_view:taxonomy_term', 'ctools_export:views_view:user_stats_ips_by_user', 'ctools_export:views_view:user_stats_online_users', 'ctools_export:views_view:user_stats_online_users_pictures', 'ctools_export:views_view:user_stats_top_posters', 'ctools_export:views_view:user_stats_users_by_ip', 'ctools_export:views_view:admin_content', 'ctools_export:views_view:admin_people', 'ctools_export:views_view:top_content')

Is this really by design?
Also, if I cache the block output of my views (with blockcache_alter), shouldn't it bypass the views queries?

thanks a bunch!

Comments

dawehner’s picture

In general you can always dramatically speed up things, if you move the cache into memcache or basically anything beside the database.

The first query is so slow, because the data size is quite big, see #1421844: views_fetch_data() cache item can reach over 10mb in size for an related issue.

This is about the second query:

So about the problem, ctools should load the value only when its needed. Could it be that some kind of cache clear happened on your site before you see this, or asked different, do you see this query on every page request?

In general this issue is something between ctools and views.

You are right, if you have blockcache enabled it should definitive not have to load the view.

bas.hr’s picture

I also had problem with certain views being fetch from the cache (db) though they are disabled and not used.

SELECT cid, data, created, expire, serialized FROM cache_views WHERE cid IN ('ctools_export:views_view:archive', 'ctools_export:views_view:frontpage', 'ctools_export:views_view:glossary', 'ctools_export:views_view:taxonomy_term')

After I applied the patch from #1421844: views_fetch_data() cache item can reach over 10mb in size my problem went away

heyyo’s picture

Version: 7.x-3.3 » 7.x-3.7
Issue summary: View changes

I have the same issue with Views 7.x-3.7.
I see calls to multiple(55) bin cache_views from Views enabled & disabled on any page of my site, even admin pages where there is no views at all.

Is there any patch for this issue ?

johnv’s picture

Are the views in the menu you are showing? The menu system loads every object in the menu to see if you are allowed to access it. See #1978176: Build menu_tree without loading so many objects

mustanggb’s picture

Status: Active » Closed (outdated)