-
Notifications
You must be signed in to change notification settings - Fork 7.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: an issue of keyword search feature in application log list #7816
fix: an issue of keyword search feature in application log list #7816
Conversation
Please fix the errors in the CI. |
OK, I will finish this work today. |
@crazywoola done. |
@realethanhsu This PR being modified to a full table scan statement, which resulted in a slow query, it could cause the database to go down. The specific SQL that caused the full table scan is as follows:
Due to the significant impact, we have rolled back for now. |
@crazywoola Sure, I will fix it soon. |
Checklist:
Important
Please review the checklist below before submitting your pull request.
dev/reformat
(backend) andcd web && npx lint-staged
(frontend) to appease the lint godsDescription
If there are multiple records in the Message table associated with the same Conversation, and some of these records contain target keywords, it can lead to duplicate Conversation records in the final query results. This results in wrong data counts and pagination issues. The revised code employs
Conversation.id.in_(message_subquery)
as a filter condition to ensure that only unique Conversations with related Messages are returned. This approach prevents duplicate Conversation records from appearing in the query results, thereby ensuring the accuracy of the log list and the proper functioning of the pagination feature.Fixes #7815
Type of Change
Testing Instructions
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration