Hello all, this is a simple question. There are some queries on our site that take too many seconds to complete (like 15 seconds!). For anonymous traffic they get a cached .html file, but for logged in users it's too slow.
The query looks like this:
SELECT node.nid, votingapi_cache_vote_percent_average.value AS votingapi_cache_vote_percent_average_value, votingapi_cache_vote_percent_count.value AS votingapi_cache_vote_percent_count_value, node.type AS node_type, users.name AS users_name, users.uid AS users_uid, node_data_field_species.field_species_nid AS node_data_field_species_field_species_nid, node.title AS node_title, node.changed AS node_changed, node.created AS node_created, node_data_field_picture.field_picture_fid AS node_data_field_picture_field_picture_fid, node_data_field_picture.field_picture_title AS node_data_field_picture_field_picture_title, node_data_field_picture.field_picture_alt AS node_data_field_picture_field_picture_alt, node_data_field_recorded.field_recorded_value AS node_data_field_recorded_field_recorded_value, node_data_field_static_location.field_static_location_value AS node_data_field_static_location_field_static_location_value, field_video_op_videos.video_id AS field_video_op_videos_preview_image_link FROM node node LEFT JOIN votingapi_cache votingapi_cache_vote_percent_average ON node.nid = votingapi_cache_vote_percent_average.content_id AND votingapi_cache_vote_percent_average.content_type = 'node' AND votingapi_cache_vote_percent_average.value_type = 'percent' AND votingapi_cache_vote_percent_average.tag = 'vote' AND votingapi_cache_vote_percent_average.function = 'average' LEFT JOIN votingapi_cache votingapi_cache_vote_percent_count ON node.nid = votingapi_cache_vote_percent_count.content_id AND votingapi_cache_vote_percent_count.content_type = 'node' AND votingapi_cache_vote_percent_count.value_type = 'percent' AND votingapi_cache_vote_percent_count.tag = 'vote' AND votingapi_cache_vote_percent_count.function = 'count' INNER JOIN users users ON node.uid = users.uid LEFT JOIN content_field_species node_data_field_species ON node.vid = node_data_field_species.vid LEFT JOIN content_type_picture node_data_field_picture ON node.vid = node_data_field_picture.vid LEFT JOIN content_field_recorded node_data_field_recorded ON node.vid = node_data_field_recorded.vid LEFT JOIN content_field_static_location node_data_field_static_location ON node.vid = node_data_field_static_location.vid LEFT JOIN content_type_video node_data_field_video ON node.vid = node_data_field_video.vid LEFT JOIN op_videos field_video_op_videos ON node_data_field_video.field_video_video_id = field_video_op_videos.video_id WHERE (node.type IN ('audio','picture','video')) AND (node.status = '1') ORDER BY votingapi_cache_vote_percent_average_value DESC, votingapi_cache_vote_percent_count_value DESC LIMIT 0, 30
Will memcache help to serve that page faster? Or, at least, second-time access to it...
Thanks