Project

Profile

Help

Issue #1476

closed

The RPM models are indexing a lot of fields that don't make sense to have indices

Added by rbarlow over 8 years ago. Updated about 5 years ago.

Status:
CLOSED - WONTFIX
Priority:
High
Assignee:
-
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
1. Low
Version:
2.4.0
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Quarter:

Description

The RPM models are setting up these indices :

"name", "epoch", "version", "release", "arch", "filename", "checksum", "checksumtype", "version_sort_index"

Almost all of these do not make sense, and they each will significantly increase the RAM required of the MongoDB server and reduce write performance. I'll go one by one and explain each:

name: The name is also indexed by the first field of the unit key uniqueness constraint that is set up on line 369 below, so this index is redundant.

epoch: Why would users search by epoch?

release: Why would users search by release?

arch: Why would users search by arch?

filename: I could see a case for this one, especially with a contains, but I'm still a little skeptical. I'm a maybe on it.

checksum: This can be a useful way to look up units, so I think it's OK.

checksumtype: Why would users search with this?

version_sort_index: This is also the first field of the compound index of version_sort_index and release_sort_index, so it is redundant like the name index.

I would mark this easy fix or even just make a pull request, but if we've made a release with this we'll need a migration to drop the indices. I haven't done the research to determine if we've released with these indices. If we haven't released, I'd consider this a 2.8 blocker.


Related issues

Related to Pulp - Issue #1477: With mongoengine models, developers have to manually configure uniqueness constraints for model unit keysCLOSED - CURRENTRELEASEdkliban@redhat.comActions
Has duplicate RPM Support - Issue #630: RPM unit types have redundant search indices specifiedCLOSED - DUPLICATEActions

Also available in: Atom PDF