discourse/plugins/chat/lib/chat
Andrei Prigorshnev a32fce9e1d
FIX: Further optimize mentioning groups in chat messages (part 2) (#24185)
This is a follow-up to e6299a3. I additionally fixed these three things:

1. Since e6299a3 there's no need anymore to join the group_users table 
when looking for users who were reached by a group mention, so 
I removed that join in that commit. But turned out we were joining 
the group_users table twice, so I removed the second join in this PR. 
That drastically speeded up my test query, from 6 sec to 0.26 sec.
2. We also were joining twice the user_chat_channel_memebership table, 
so I removed the second unnecessary join too.
3. We actually need to join the user_chat_channel_memebership table 
only in certain cases, and we don't need to do that for group mentions, 
so I fixed that too.

As a result of these changes, time of my test query fall down from 
6 sec to 0.001 sec. And the resulting SQL query now contains only 
one JOIN statement.
2023-11-01 17:05:54 +04:00
..
types FIX: ActiveModel::Types :array load error in production (#22377) 2023-07-03 11:30:09 +10:00
bookmark_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
category_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
channel_archive_service.rb DEV: Remove enable_experimental_hashtag_autocomplete logic (#22820) 2023-08-08 11:18:55 +10:00
channel_fetcher.rb DEV: Migrate Chat::MessageCreator to a service (#22390) 2023-09-07 08:57:29 +02:00
channel_hashtag_data_source.rb DEV: Remove enable_experimental_hashtag_autocomplete logic (#22820) 2023-08-08 11:18:55 +10:00
channel_membership_manager.rb FEATURE: Auto-remove users without permission from channel (#20344) 2023-03-22 10:19:59 +10:00
duplicate_message_validator.rb
engine.rb FEATURE: Add onebox support for chat threads (#23580) 2023-10-25 14:30:39 +02:00
guardian_extensions.rb FEATURE: thread pagination (#22624) 2023-07-27 09:57:03 +02:00
mailer.rb
message_bookmarkable.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
message_mover.rb DEV: Migrate Chat::MessageCreator to a service (#22390) 2023-09-07 08:57:29 +02:00
message_processor.rb DEV: Consistently use html5 loofah (#22711) 2023-07-20 12:01:45 +02:00
message_rate_limiter.rb
message_reactor.rb
messages_exporter.rb FIX: Don't fail when exporting chat messages from deleted channels (#23131) 2023-08-18 14:22:24 +04:00
notification_levels.rb FIX: Chat NotificationLevels extension breaking in prod (#21484) 2023-05-10 18:46:06 +02:00
notifier.rb FIX: Further optimize mentioning groups in chat messages (#24122) 2023-10-31 18:17:37 +04:00
onebox_handler.rb FEATURE: Add onebox support for chat threads (#23580) 2023-10-25 14:30:39 +02:00
outgoing_web_hook_extension.rb FEATURE: granular webhooks (#23070) 2023-10-09 03:35:31 +00:00
parsed_mentions.rb FIX: Further optimize mentioning groups in chat messages (part 2) (#24185) 2023-11-01 17:05:54 +04:00
plugin_instance_extension.rb
post_notification_handler.rb
review_queue.rb FIX: Create a reviewable when flagging a chat message for 'something else' (#23264) 2023-08-25 17:38:27 +08:00
reviewable_extension.rb DEV: Refactor STI/polymorphic associations in chat (#20789) 2023-04-17 15:41:56 +02:00
secure_uploads_compatibility.rb
seeder.rb
slack_compatibility.rb
statistics.rb
steps_inspector.rb DEV: Add policy objects to services 2023-05-25 12:34:00 +02:00
transcript_service.rb
user_email_extension.rb
user_extension.rb DEV: Create UserChatThreadMembership table and model (#21481) 2023-05-10 17:19:48 +02:00
user_notifications_extension.rb DEV: removes deprecated code (#23183) 2023-08-22 15:53:37 +02:00
user_option_extension.rb FEATURE: Add new chat indicator preference for Only Mentions (#23848) 2023-10-27 15:58:19 +08:00