Clicking though from users to a users /admin/users/{username}
page takes too long…
… so long I consider this a bug.
Here is a screen capture of a click from the Admin Users list screen to a users admin page.
This is actually quite a fast example at ~32 seconds on a desktop browser (Chrome 39).
This makes clicking between profiles crazy painful.
I’m currently running:
Discourse 1.2.0.beta4 - https://github.com/discourse/discourse version 3cea85e09a5a86d7a965fb2ffd8b132659b79db0
##Profiler Entries
It doesn’t appear to be the queries that are actually slow - it appears to be the “Executing action: show”.
Here are a few examples
#1
Executing action: show
T+534.5 ms
Reader
0.5 ms
####Query
app/models/trust_level3_requirements.rb:218:in `flagged_post_ids'
app/models/trust_level3_requirements.rb:125:in `num_flagged_posts'
app/models/trust_level3_requirements.rb:36:in `requirements_met?'
app/serializers/trust_level3_requirements_serializer.rb:24:in `requirements_met'
lib/freedom_patches/ams_include_without_root.rb:55:in `include!'
app/controllers/application_controller.rb:207:in `serialize_data'
app/controllers/application_controller.rb:216:in `render_serialized'
app/controllers/admin/users_controller.rb:41:in `show'
lib/middleware/anonymous_cache.rb:119:in `call'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:36.359430' AND (spam_count > 0 OR inappropriate_count > 0))
####Result
Executing action: show — 1750.50 ms
#2
Executing action: show
T+2296.5 ms
Reader
0.5 ms
####Query
app/models/trust_level3_requirements.rb:218:in `flagged_post_ids'
app/models/trust_level3_requirements.rb:138:in `num_flagged_by_users'
app/models/trust_level3_requirements.rb:37:in `requirements_met?'
app/serializers/trust_level3_requirements_serializer.rb:24:in `requirements_met'
lib/freedom_patches/ams_include_without_root.rb:55:in `include!'
app/controllers/application_controller.rb:207:in `serialize_data'
app/controllers/application_controller.rb:216:in `render_serialized'
app/controllers/admin/users_controller.rb:41:in `show'
lib/middleware/anonymous_cache.rb:119:in `call'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:38.134558' AND (spam_count > 0 OR inappropriate_count > 0))
####Result
Executing action: show — 1804.70 ms
#3
executing action: show
T+209.2 ms
Reader
0.8 ms
####Query
app/models/trust_level3_requirements.rb:80:in num_topics_replied_to' app/models/trust_level3_requirements.rb:33:in
requirements_met?’
app/serializers/trust_level3_requirements_serializer.rb:24:in requirements_met' lib/freedom_patches/ams_include_without_root.rb:55:in
include!’
app/controllers/application_controller.rb:207:in serialize_data' app/controllers/application_controller.rb:216:in
render_serialized’
app/controllers/admin/users_controller.rb:41:in show' lib/middleware/anonymous_cache.rb:119:in
call’
lib/middleware/unicorn_oobgc.rb:95:in `process_client’
SELECT COUNT(distinct topic_id) FROM "posts" WHERE ("posts"."deleted_at" IS NULL) AND "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:36.041733' AND post_number > 1)
244.50 ms
####Result
Executing action: show — 244.50 ms
##More
There are more too - but simply put they include:
1575.50 ms - SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:40.053569' AND (spam_count > 0 OR inappropriate_count > 0))
2175.90 ms - SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:41.625914' AND (spam_count > 0 OR inappropriate_count > 0))
1800.90 ms - SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:43.889573' AND (spam_count > 0 OR inappropriate_count > 0))
1385.30 ms - SELECT "posts"."id" FROM "posts" WHERE "posts"."user_id" = $1 AND (created_at > '2014-10-10 21:57:45.688083' AND (spam_count > 0 OR inappropriate_count > 0))