Issue #1476
closedThe RPM models are indexing a lot of fields that don't make sense to have indices
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