mirror of
https://github.com/discourse/discourse.git
synced 2025-01-18 13:32:45 +08:00
ddb458343d
First reported in https://meta.discourse.org/t/-/202482/19 There are two optimizations being applied here: 1. Fetch a user's group ids in a seperate query instead of including it as a sub-query. When I tried a subquery, the query plan becomes very inefficient. 1. Join against the `topic_allowed_users` and `topic_allowed_groups` table instead of doing an IN against a subquery where we UNION the `topic_id`s from the two tables. From my profiling, this enables PG to do a backwards index scan on the `index_topics_on_timestamps_private` index. This commit fixes a bug where listing all messages was incorrectly excluding topics if a topic has been archived by a group even if the user did not belong to the group. This commit also fixes another bug where dismissing private messages selectively was subjected to the default limit of 30. |
||
---|---|---|
.. | ||
backup_restore | ||
compression | ||
content_security_policy | ||
i18n | ||
imap/providers | ||
onebox | ||
seed_data | ||
site_settings | ||
topic_query | ||
validators | ||
webauthn | ||
bookmark_manager_spec.rb | ||
bookmark_query_spec.rb | ||
bookmark_reminder_notification_handler_spec.rb | ||
browser_detection_spec.rb | ||
content_security_policy_spec.rb | ||
db_helper_spec.rb | ||
discourse_js_processor_spec.rb | ||
encodings_spec.rb | ||
introduction_updater_spec.rb | ||
mini_sql_multisite_connection_spec.rb | ||
onebox_spec.rb | ||
post_jobs_enqueuer_spec.rb | ||
search_spec.rb | ||
shrink_uploaded_image_spec.rb | ||
theme_flag_modifier_spec.rb | ||
theme_javascript_compiler_spec.rb | ||
topic_upload_security_manager_spec.rb | ||
upload_creator_spec.rb | ||
upload_recovery_spec.rb | ||
upload_security_spec.rb |