Advertisement
Guest User

Slow SQL query in Views relationship from Content Profile

a guest
Aug 8th, 2014
368
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
SQL 2.10 KB | None | 0 0
  1. SELECT node.nid AS nid,
  2.        node_users_node_data_field_photo.field_photo_fid AS node_users_node_data_field_photo_field_photo_fid,
  3.        node_users_node_data_field_photo.field_photo_list AS node_users_node_data_field_photo_field_photo_list,
  4.        node_users_node_data_field_photo.field_photo_data AS node_users_node_data_field_photo_field_photo_data,
  5.        node_users.nid AS node_users_nid,
  6.        node_users.LANGUAGE AS node_users_language,
  7.        node_users.TYPE AS node_users_type,
  8.        node_users.vid AS node_users_vid,
  9.        users.name AS users_name,
  10.        users.uid AS users_uid,
  11.        node.TYPE AS node_type,
  12.        node.LANGUAGE AS node_language,
  13.        node.title AS node_title,
  14.        node.created AS node_created,
  15.        userpoints.points AS userpoints_points,
  16.        node.vid AS node_vid,
  17.        node_revisions.teaser AS node_revisions_teaser,
  18.        node_revisions.format AS node_revisions_format,
  19.        'taxonomy_views:page_1' AS view_name
  20. FROM node node
  21. INNER JOIN users users ON node.uid = users.uid
  22. LEFT JOIN node node_users ON users.uid = node_users.uid
  23. AND node_users.TYPE = 'profile'
  24. INNER JOIN content_type_profile node_users_node_data_field_photo ON node_users.vid = node_users_node_data_field_photo.vid
  25. LEFT JOIN userpoints userpoints ON node.uid = userpoints.uid
  26. LEFT JOIN node_revisions node_revisions ON node.vid = node_revisions.vid
  27. WHERE (EXISTS
  28.          (SELECT na.nid
  29.           FROM node_access na
  30.           WHERE node.nid = na.nid
  31.             AND (na.grant_view >= 1
  32.                  AND ((na.gid = 0
  33.                        AND na.realm = 'all')
  34.                       OR (na.gid = 1
  35.                           AND na.realm = 'workflow_access')
  36.                       OR (na.gid = 0
  37.                           AND na.realm = 'workflow_access_owner')
  38.                       OR (na.gid = 0
  39.                           AND na.realm = 'og_public')))))
  40.   AND ((node.STATUS <> 0
  41.         OR (node.uid = 0 AND 0 <> 0)
  42.         OR 0 = 1)
  43.        AND (node.vid IN
  44.               ( SELECT tn.vid
  45.                FROM term_node tn
  46.                WHERE tn.tid = 11855 )) )
  47. LIMIT 0, 10
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement