[SERVER-80961] Introduce view types for DatabaseName Created: 11/Sep/23  Updated: 18/Jan/24  Resolved: 18/Jan/24

Status: Closed
Project: Core Server
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Matt Broadstone Assignee: Didier Nadeau
Resolution: Won't Do Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to SERVER-81569 Improve performance of NamespaceString In Code Review
Assigned Teams:
Service Arch
Sprint: Service Arch 2023-11-27, Service Arch 2023-12-11, Service Arch 2023-12-25, Service Arch 2024-01-08, Service Arch 2024-01-22
Participants:

 Description   

We have recently made changes to prefer DatabaseName over std::string when referring to databases throughout the codebase, which has in some cases introduced new allocations. We should introduce a new DatabaseNameView type, mirroring the optimization of using StringData when database names were passed as std::string.



 Comments   
Comment by Didier Nadeau [ 18/Jan/24 ]

We've decided to make NamespaceString inherit from DatabaseName (SERVER-84311). This means `dbName()` will returns a `const DatabaseName&` and avoid allocation of a new value which makes this change unecessary.

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