discourse/app/jobs/scheduled
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
..
about_stats.rb FIX: Fetch stats if it has not been cached. 2016-04-21 14:50:25 +08:00
badge_grant.rb don't bother iterating over disabled badges 2016-01-18 21:41:12 +01:00
calculate_avg_time.rb New badge, Rookie of the Month, for two new high quality users. 2017-03-31 15:06:31 -04:00
category_stats.rb PERF: only run category stats once a day 2014-08-11 09:41:50 +10:00
clean_up_email_logs.rb FIX: don't use destroy_all when delete_all is enough 2016-03-05 00:41:22 +01:00
clean_up_exports.rb Rename CsvExportLog to UserExport 2014-12-28 22:31:12 +05:30
clean_up_unmatched_emails.rb ooops. forgot the args :fired: 2014-11-25 18:45:45 +01:00
clean_up_unmatched_ips.rb FEATURE: Use created_at to remove an ip if its last_match_at is null 2015-06-05 10:51:13 -04:00
clean_up_unsubscribe_keys.rb FEATURE: simpler and friendlier unsubscribe workflow 2016-06-17 11:28:49 +10:00
clean_up_unused_staged_users.rb FIX: Clean up unused staged users job not completing. 2017-04-26 10:51:36 +08:00
clean_up_uploads.rb Allow theme field object model to support uploads 2017-05-10 15:46:42 -04:00
create_missing_avatars.rb workaround issue where orphan user_avatar record exists 2016-05-17 09:40:17 +10:00
dashboard_stats.rb FIX: Fetch stats if it has not been cached. 2016-04-21 14:50:25 +08:00
destroy_old_deletion_stubs.rb FEATURE: new scheduler 2014-02-06 10:26:16 +11:00
destroy_old_hidden_posts.rb FEATURE: auto-delete any hidden posts that stay hidden for more than 30 days 2014-09-25 19:51:00 +02:00
directory_refresh_daily.rb PERF: Only refresh the Daily stats hourly, do the others daily. 2015-04-20 12:11:36 -04:00
directory_refresh_older.rb PERF: Only refresh the Daily stats hourly, do the others daily. 2015-04-20 12:11:36 -04:00
disable_bootstrap_mode.rb FIX: Improve checks for non-human users. 2017-04-06 11:29:34 +08:00
enqueue_digest_emails.rb FEATURE: secure_email site setting to prevent data going out in email 2017-04-26 13:05:56 -04:00
enqueue_onceoffs.rb Try running once off jobs outside of db:migrate 2016-04-07 15:07:24 -04:00
ensure_db_consistency.rb FEATURE: handle bounced emails 2016-05-02 23:15:32 +02:00
grant_anniversary_badges.rb Change Anniversary badge to be multiple grant, once per year 2017-04-28 14:22:54 -04:00
grant_new_user_of_the_month_badges.rb FIX: Fixes to grant new user of the month badge 2017-05-24 11:36:24 -04:00
heartbeat.rb FEATURE: unicorn sidekiq will restart sidekiq on complete failure. 2014-04-23 13:13:18 +10:00
migrate_upload_scheme.rb FIX: Incorrect folder. 2016-09-15 15:20:07 +08:00
pending_flags_reminder.rb FIX: possible data leaking from one site to another in multisite in PendingFlagsReminder 2017-05-22 15:18:13 -04:00
pending_queued_posts_reminder.rb FIX: remove memoized values in jobs 2017-05-22 16:26:30 -04:00
pending_users_reminder.rb FEATURE: Add order logic to admin users controller 2017-02-24 17:11:17 -07:00
periodical_updates.rb rename topic_status_update to topic_timer 2017-05-11 18:27:53 -04:00
poll_feed.rb FIX: remove memoized values in jobs 2017-05-22 16:26:30 -04:00
poll_mailbox.rb Add “pop3_polling_openssl_verify” setting to turn off TLS server certificate verification like “smtp_openssl_verify_mode”. Defaults to “true”, so it does not change current behavior. 2016-11-11 21:59:15 +01:00
process_badge_backlog.rb FIX: faster update of all badges 2014-07-23 11:46:07 +10:00
purge_deleted_uploads.rb FEATURE: new scheduler 2014-02-06 10:26:16 +11:00
purge_inactive.rb rename purge_inactive to purge_unactivated 2014-12-02 21:36:25 -08:00
reindex_search.rb PERF: push reindex job to daily 2014-07-01 10:09:55 +10:00
schedule_backup.rb FIX: compare UTC dates to schedule backups 2015-11-12 18:35:03 +01:00
tl3_promotions.rb Rename 'leader' -> 'tl3' 2014-09-30 13:16:34 +10:00
top_refresh_older.rb OPTIMIZATION: Don't run 12 queries every 15 mins for the Top section. 2014-08-01 16:25:20 -04:00
top_refresh_today.rb OPTIMIZATION: Don't run 12 queries every 15 mins for the Top section. 2014-08-01 16:25:20 -04:00
update_first_topic_unread_at.rb PERF: improve performance of unread queries 2017-05-25 15:07:30 -04:00
version_check.rb FEATURE: allow version emails to be disabled globally 2014-08-23 10:02:32 +10:00
weekly.rb FEATURE: per client user tokens 2017-02-07 09:22:16 -05:00