Bug 1033195

Summary: Our base Model class indexes the id field as a unique field by default, causing duplicate indexes on at least one model
Product: [Retired] Pulp Reporter: Randy Barlow <rbarlow>
Component: z_otherAssignee: pulp-bugs
Status: CLOSED UPSTREAM QA Contact: pulp-qe-list
Severity: medium Docs Contact:
Priority: medium    
Version: MasterCC: mhrivnak
Target Milestone: ---Keywords: Triaged
Target Release: ---   
Hardware: All   
OS: All   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-28 22:00:01 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Randy Barlow 2013-11-21 16:49:38 UTC
We have an opportunity to reduce our MongoDB memory usage. I discovered recently that our base Model class indexes the id field as a unique index. The id field is defaulted to a string representation of the _id field (which probably isn't terribly useful). Since _id must always be indexed in MongoDB, we essentially index that same information two different ways (which uses more RAM).

I am not sure how many models this affects, but I did find at least one: the CallResource Model. It doesn't override the id field, and it does not override the unique_indexes class attribute.

Comment 1 Brian Bouterse 2015-02-28 22:00:01 UTC
Moved to https://pulp.plan.io/issues/385