Bug 1033195 - Our base Model class indexes the id field as a unique field by default, causing duplicate indexes on at least one model
Summary: Our base Model class indexes the id field as a unique field by default, causi...
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Pulp
Classification: Retired
Component: z_other
Version: Master
Hardware: All
OS: All
medium
medium
Target Milestone: ---
: ---
Assignee: pulp-bugs
QA Contact: pulp-qe-list
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-11-21 16:49 UTC by Randy Barlow
Modified: 2015-02-28 22:00 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2015-02-28 22:00:01 UTC
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 385 0 None None None Never

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


Note You need to log in before you can comment on or make changes to this bug.