-
Notifications
You must be signed in to change notification settings - Fork 15.9k
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
Mongo index creation #17748
Mongo index creation #17748
Conversation
nvenkat94
commented
Feb 19, 2024
- Title: Mongodb: MongoDB connection performance improvement.
- Message:
- Description: I made collection index_creation as optional. Index Creation is one time process.
- Issue: MongoDBChatMessageHistory class object is attempting to create an index during connection, causing each request to take longer than usual. This should be optional with a parameter.
- Dependencies: N/A
- Branch to be checked: origin/mongo_index_creation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
""" | ||
Conditional Index Creation for collection | ||
""" | ||
self.collection.create_index("SessionId") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
would you ever want to specify index_name as well? if so could there be one paramter
index_name: Optional[str] = "SessionID"
and if index_name is None then you skip index creation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe the 'index_name' parameter is not necessary at the moment. However, we currently use 'SessionID' in three other places. If provided, users can modify the key name as they wish. If you wish add index_name parameter, I can do it.
- [ ] Title: Mongodb: MongoDB connection performance improvement. - [ ] Message: - **Description:** I made collection index_creation as optional. Index Creation is one time process. - **Issue:** MongoDBChatMessageHistory class object is attempting to create an index during connection, causing each request to take longer than usual. This should be optional with a parameter. - **Dependencies:** N/A - **Branch to be checked:** origin/mongo_index_creation --------- Co-authored-by: Bagatur <[email protected]>
- [ ] Title: Mongodb: MongoDB connection performance improvement. - [ ] Message: - **Description:** I made collection index_creation as optional. Index Creation is one time process. - **Issue:** MongoDBChatMessageHistory class object is attempting to create an index during connection, causing each request to take longer than usual. This should be optional with a parameter. - **Dependencies:** N/A - **Branch to be checked:** origin/mongo_index_creation --------- Co-authored-by: Bagatur <[email protected]>