Very similar query repeated 3 times on topic load


(Dean Taylor) #1

Very similar query repeated 3 times on topic load after recent rebuild…

Although probably a complete non-issue, but just seemed odd and may point towards another performance optimisation.

Notes:

  • no LIMIT 1 included in last query
  • Additional space between SELECT and "users" in second query.
Executing action: show
T+74.2 ms
Reader
0.8 ms
lib/topic_view.rb:71:in `initialize'
app/controllers/topics_controller.rb:59:in `new'
app/controllers/topics_controller.rb:59:in `show'
lib/middleware/anonymous_cache.rb:129:in `call'
config/initializers/100-quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/100-silence_logger.rb:26:in `call'
lib/middleware/request_tracker.rb:73:in `call'
lib/scheduler/defer.rb:85:in `process_client'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
SELECT "users".* FROM "users" WHERE "users"."id" IN (1)
Executing action: show
T+179.0 ms
Reader
1.0 ms
app/serializers/topic_view_serializer.rb:65:in `details'
app/controllers/application_controller.rb:259:in `render_json_dump'
app/controllers/topics_controller.rb:580:in `block (2 levels) in perform_show_response'
app/controllers/topics_controller.rb:572:in `perform_show_response'
app/controllers/topics_controller.rb:89:in `show'
lib/middleware/anonymous_cache.rb:129:in `call'
config/initializers/100-quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/100-silence_logger.rb:26:in `call'
lib/middleware/request_tracker.rb:73:in `call'
lib/scheduler/defer.rb:85:in `process_client'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
SELECT  "users".* FROM "users" WHERE "users"."id" = 1 LIMIT 1
Executing action: show
T+194.2 ms
Reader
0.8 ms
lib/topic_view.rb:270:in `participants'
app/serializers/topic_view_serializer.rb:86:in `block in details'
app/serializers/topic_view_serializer.rb:85:in `each'
app/serializers/topic_view_serializer.rb:85:in `map'
app/serializers/topic_view_serializer.rb:85:in `details'
app/controllers/application_controller.rb:259:in `render_json_dump'
app/controllers/topics_controller.rb:580:in `block (2 levels) in perform_show_response'
app/controllers/topics_controller.rb:572:in `perform_show_response'
app/controllers/topics_controller.rb:89:in `show'
lib/middleware/anonymous_cache.rb:129:in `call'
config/initializers/100-quiet_logger.rb:10:in `call_with_quiet_assets'
config/initializers/100-silence_logger.rb:26:in `call'
lib/middleware/request_tracker.rb:73:in `call'
lib/scheduler/defer.rb:85:in `process_client'
lib/middleware/unicorn_oobgc.rb:95:in `process_client'
SELECT "users".* FROM "users" WHERE "users"."id" = 1