# Loading times Admin User pages

**URL:** <https://meta.discourse.org/t/loading-times-admin-user-pages/24157>\
**Category:** Bug\
**Created:** [January 18, 2015, 10:19pm UTC](https://meta.discourse.org/t/loading-times-admin-user-pages/24157 "2015-01-18T22:19:39Z")\
**Posts on this page:** 1\
**Showing post:** 1

<div class="post-metadata">

**Author:** ![DeanMarkTaylor](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/deanmarktaylor/32/102462_2.png) [@DeanMarkTaylor](https://meta.discourse.org/u/DeanMarkTaylor)\
**Post date:** [January 18, 2015, 10:19pm UTC](https://meta.discourse.org/t/loading-times-admin-user-pages/24157/1 "2015-01-18T22:19:39Z")

</div>

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).  
 ![](https://global.discourse-cdn.com/meta/original/3X/f/2/f22640cd49cd77cd080c4d1dae9da84cf21af72a.gif)

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)) `

---

_[View the full topic](https://meta.discourse.org/t/loading-times-admin-user-pages/24157)._
