discourse/app/controllers
Sam 29fac1ac18 PERF: improve performance of unread queries
Figuring out what unread topics a user has is a very expensive
operation over time.

Users can easily accumulate 10s of thousands of tracking state rows
(1 for every topic they ever visit)

When figuring out what a user has that is unread we need to join
the tracking state records to the topic table. This can very quickly
lead to cases where you need to scan through the entire topic table.

This commit optimises it so we always keep track of the "first" date
a user has unread topics. Then we can easily filter out all earlier
topics from the join.

We use pg functions, instead of nested queries here to assist the
planner.
2017-05-25 15:07:30 -04:00
..
admin improve error on theme upload, add gif to allowed uploads 2017-05-17 16:29:09 -04:00
users Revert "FIX: If login is required, redirect to the /login route instead of root" 2017-05-25 14:04:28 -04:00
about_controller.rb FIX: do not show about page to anonymous users for private forums 2017-03-08 13:15:44 +05:30
application_controller.rb FIX: Keep the flash when redirecting for login_required 2017-05-25 14:10:15 -04:00
badges_controller.rb FEATURE: add og tags to metadata in individual badges page 2017-04-06 09:32:53 +05:30
categories_controller.rb FEATURE: category setting for default top period 2017-03-22 16:54:18 -04:00
category_hashtags_controller.rb FIX: Query for category hashtag should be case sensitive. 2016-03-28 11:15:10 +08:00
clicks_controller.rb PERF: avoid preloading json in cases where it is not needed 2015-05-20 17:12:16 +10:00
composer_messages_controller.rb FIX: Duplicate link shouldn't happen on edit 2016-06-08 17:22:23 -04:00
directory_items_controller.rb PERF: Remove ordering by username. 2016-10-15 01:13:58 +08:00
draft_controller.rb PERF: avoid preloading json in cases where it is not needed 2015-05-20 17:12:16 +10:00
email_controller.rb User interface for watching first post 2016-07-07 11:21:50 -04:00
embed_controller.rb Add get_embeddable_css_class to assist multi-site embed styling 2017-05-11 15:16:16 -04:00
exceptions_controller.rb SECURITY: prefer render plain/html to render text where possible 2017-04-10 08:01:42 -04:00
export_csv_controller.rb SECURITY: Validate the entity when downloading a CSV 2017-05-19 16:00:51 -04:00
extra_locales_controller.rb FIX: eradicate I18n fallback issues 💣 2017-02-24 11:31:21 +01:00
finish_installation_controller.rb FIX: Show an error page if finish-installation can't run 2016-12-07 11:10:08 -05:00
forums_controller.rb SECURITY: prefer render plain/html to render text where possible 2017-04-10 08:01:42 -04:00
groups_controller.rb FEATURE: default notification level for group messages 2017-04-20 15:47:35 -04:00
highlight_js_controller.rb FEATURE: add immutable caching to rails site of things 2017-02-23 13:05:00 -05:00
invites_controller.rb FIX: rescue specific errors on invite failure 2017-05-02 15:13:33 +05:30
list_controller.rb FIX: Possible 500 error if category saved incorrectly 2017-05-08 15:17:58 -04:00
metadata_controller.rb Use natural orientation for web app manifest. 2017-02-12 18:04:06 +00:00
notifications_controller.rb FIX: Incorrect error raised. 2017-04-25 09:59:01 +08:00
onebox_controller.rb SECURITY: prefer render plain/html to render text where possible 2017-04-10 08:01:42 -04:00
permalinks_controller.rb FIX: permalinks redirect on subfolder installs could add the subfolder to the url twice 2015-10-12 16:54:53 -04:00
post_action_users_controller.rb FIX: You can click to see your own PMs from flags 2015-09-30 12:28:55 -04:00
post_actions_controller.rb FIX: Return 404 if id is not valid. 2017-01-06 10:39:44 +08:00
posts_controller.rb FIX: User can't remove bookmark from a deleted post. 2017-05-19 12:25:12 +08:00
queued_posts_controller.rb FIX: better error message when trying to approve post for closed/deleted topic 2016-06-24 15:11:45 +05:30
robots_txt_controller.rb FIX: robots.txt should be accessible even when login is required 2015-10-15 11:42:41 +02:00
safe_mode_controller.rb FIX: Incorrect path for redirect. 2016-12-19 18:12:15 +08:00
search_controller.rb SECURITY: restrict constantize classes in search controller 2016-06-17 13:47:34 +10:00
session_controller.rb Improve SSO verbose log when user record is invalid. 2017-04-13 11:39:26 +08:00
similar_topics_controller.rb FIX: similar topics api shouldn't return error if params are below minimum lengths 2015-08-31 10:54:45 -04:00
site_controller.rb FEATURE: Send anonymized usage statistics to Discourse if Discourse Hub can't reach the site 2017-03-28 09:07:23 +05:30
static_controller.rb Refactor FileHelper to use keyword arguments. 2017-05-24 13:54:26 -04:00
steps_controller.rb FIX: You should be an admin to do the wizard 2016-09-22 11:12:51 -04:00
stylesheets_controller.rb FEATURE: Native theme support 2017-04-12 10:53:49 -04:00
tag_groups_controller.rb PERF: tag groups index query 2016-07-15 17:16:26 -04:00
tags_controller.rb FIX: tags created in secured categories should not be forbidden outside those categories 2017-03-07 11:46:46 -05:00
themes_controller.rb FEATURE: Native theme support 2017-04-12 10:53:49 -04:00
topics_controller.rb PERF: improve performance of unread queries 2017-05-25 15:07:30 -04:00
uploads_controller.rb Refactor FileHelper to use keyword arguments. 2017-05-24 13:54:26 -04:00
user_actions_controller.rb got to be careful with integrity specs 2016-11-29 18:01:09 +11:00
user_api_keys_controller.rb FEATURE: user API now contains scopes so permission is granular 2016-10-14 16:05:42 +11:00
user_avatars_controller.rb Refactor FileHelper to use keyword arguments. 2017-05-24 13:54:26 -04:00
user_badges_controller.rb FIX: badge grant count wasn't filtered to the current user in the user summary 2016-03-30 23:11:00 +02:00
users_controller.rb FIX: Quiet server side errors for requesting json for account-created 2017-05-04 12:30:13 -04:00
users_email_controller.rb reset bounce score when email is successfully changed 2017-02-20 10:37:01 +01:00
webhooks_controller.rb FIX: bounce webhooks should also use recipient address 2017-02-05 19:06:35 +01:00
wizard_controller.rb FIX: You should be an admin to do the wizard 2016-09-22 11:12:51 -04:00