Skip to content

Instantly share code, notes, and snippets.

@rmanalan
Created March 16, 2009 23:34
Show Gist options
  • Select an option

  • Save rmanalan/80170 to your computer and use it in GitHub Desktop.

Select an option

Save rmanalan/80170 to your computer and use it in GitHub Desktop.
SQL (36358.0ms) SELECT count(1) AS count_1 FROM activities JOIN posts ON activities.subject_id = posts.id WHERE (exists (SELECT 1 FROM groups_posts JOIN groups_user_profiles my_groups_user_profiles
ON groups_posts.group_id = my_groups_user_profiles.group_id AND my_groups_user_profiles.user_profile_id = 78197
WHERE posts.id = groups_posts.post_id OR posts.parent_id = groups_posts.post_id) AND
activities.user_profile_id <> 78197 AND subject_type = 'Post')
Cache write (will save 36928.00ms): c78197scopegroupscontrolleractivitiesactionindex31count
Cache miss: c78197scopegroupscontrolleractivitiesactionindex31 ({:expires_in=>60 seconds})
Activity Load Including Associations (35886.0ms) select * from (select raw_sql_.*, rownum raw_rnum_ from (SELECT activities.id AS t0_r0, activities.action AS t0_r1, activities.subject_id AS t0_r2, activities.subject_type AS t0_r3, activities.user_profile_id AS t0_r4, activities.created_at AS t0_r5, activities.updated_at AS t0_r6, activities.appl_id AS t0_r7, activities.title AS t0_r8, activities.body AS t0_r9, activities.external_id AS t0_r10, activities.priority AS t0_r11, activities.stream_favicon_url AS t0_r12, activities.stream_source_url AS t0_r13, activities.stream_title AS t0_r14, activities.stream_url AS t0_r15, activities.url AS t0_r16, activities.group_id AS t0_r17, locations.id AS t1_r0, locations.user_profile_id AS t1_r1, locations.activity_id AS t1_r2, locations.address AS t1_r3, locations.lat AS t1_r4, locations.lng AS t1_r5, locations.created_at AS t1_r6, locations.updated_at AS t1_r7, locations.street_address AS t1_r8, locations.city AS t1_r9, locations.state AS t1_r10, locations.zip AS t1_r11, locations.country AS t1_r12 FROM activities LEFT OUTER JOIN locations ON locations.activity_id = activities.id JOIN posts ON activities.subject_id = posts.id WHERE (exists (SELECT 1 FROM groups_posts JOIN groups_user_profiles my_groups_user_profiles
ON groups_posts.group_id = my_groups_user_profiles.group_id AND my_groups_user_profiles.user_profile_id = 78197
WHERE posts.id = groups_posts.post_id OR posts.parent_id = groups_posts.post_id) AND
activities.user_profile_id <> 78197 AND subject_type = 'Post') ORDER BY activities.created_at DESC, activities.id, activities.id desc) raw_sql_ where rownum <= 20) where raw_rnum_ > 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment