[SERVER-18624] listCollections command should not be O(n^2) on MMAPv1 Created: 21/May/15  Updated: 07/Oct/15  Resolved: 21/Sep/15

Status: Closed
Project: Core Server
Component/s: Performance, Storage
Affects Version/s: None
Fix Version/s: 3.0.7, 3.1.9

Type: Improvement Priority: Critical - P2
Reporter: Mathias Stearn Assignee: Charlie Swanson
Resolution: Done Votes: 2
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by SERVER-20336 O(N^2) perf regression in listCollect... Closed
Related
related to SERVER-18622 listCollections command should specia... Closed
Backwards Compatibility: Fully Compatible
Backport Completed:
Sprint: Quint 9 09/18/15
Participants:

 Description   

Currently it gets the list of namespaces then gets the CollectionOptions for each namespace. The second step involves a table-scan of system.namespaces. Due to SERVER-18622 this happens even if you are only requesting information for a single namespace.

Instead, the storageEngine API should have a way to get all namespaces and their CollectionOptions in one pass. This should speed up both MMAP and KVCatalog-based engines.



 Comments   
Comment by Githook User [ 21/Sep/15 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-18624 Track location of collection in system.namespaces

This makes it constant time to get the collection options for a collection,
reducing the complexity of the listCollections command and other operations.
Branch: v3.0
https://github.com/mongodb/mongo/commit/72db604ab2c9a4425f5876c0cbe021c709d67fa4

Comment by Githook User [ 21/Sep/15 ]

Author:

{u'username': u'cswanson310', u'name': u'Charlie Swanson', u'email': u'charlie.swanson@mongodb.com'}

Message: SERVER-18624 Track location of collection in system.namespaces

This makes it constant time to get the collection options for a collection,
reducing the complexity of the listCollections command and other operations.
Branch: master
https://github.com/mongodb/mongo/commit/d08604d76f5d419cd2d210b3199f8912de33db9c

Generated at Thu Feb 08 03:48:16 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.