NuGet/NuGetGallery — Issue #264: Investigate better index clustering
Author: jeffhandley
Created: 2011-11-22 21:52:20+00:00
State: open

By default, EF gives us clustered indexes on primary key fields. This is not usually the way we find data though, as we usually find records by natural key instead. For instance, the Packages table would likely be better off with a clustered index over the following fields:

* PackageRegistrationKey
* IsLatest
* Version
* IsLatestStable
* Listed
* IsPrerelease

In order to implement this clustered index, we would need to remove the clustered PK index and make the PK non-clustered. We should investigate going this route and see if EF causes us any fits or if this can be safely done through a migration. When doing this, we should use the same logic on each of the tables, identifying where natural keys are better choices for the clustered indexes.