Add indexes to documents_questions table for improved query performance#247
Open
vswamidass-sfdc wants to merge 2 commits intomainfrom
Open
Add indexes to documents_questions table for improved query performance#247vswamidass-sfdc wants to merge 2 commits intomainfrom
vswamidass-sfdc wants to merge 2 commits intomainfrom
Conversation
Collaborator
vswamidass-sfdc
commented
Mar 14, 2026
- Added composite indexes on the documents_questions table for the columns document_id and question_id in both orders.
- Updated schema version to reflect the changes made by the new migration.
- Added composite indexes on the documents_questions table for the columns document_id and question_id in both orders. - Updated schema version to reflect the changes made by the new migration.
- Updated the `set_library` method to preload associated users for improved efficiency. - Added batch document statistics retrieval in the `show` action of `LibrariesController` to reduce query load. - Preloaded recent documents to avoid N+1 query issues and optimized the display of document counts in the view. - Introduced new indexes in the database to support efficient querying of document statistics. This commit improves performance and user experience on the library show page.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.