Index Device by user and last activity date - #8314
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #8314 +/- ##
===========================================
+ Coverage 17.70% 69.56% +51.86%
===========================================
Files 1480 2471 +991
Lines 64163 105935 +41772
Branches 5148 9601 +4453
===========================================
+ Hits 11359 73695 +62336
+ Misses 52607 29777 -22830
- Partials 197 2463 +2266 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
🤖 Bitwarden Claude Code ReviewOverall Assessment: APPROVE Reviewed the additive |
b5eca58 to
674b2af
Compare
🎟️ Tracking
PM-35924
📔 Objective
Adds
IX_Device_UserId_LastActivityDate_Typetodbo.Device, serving the member adoption report's two per-memberDeviceprobes.dbo.Deviceis a large production table. The DDL is guarded byIF NOT EXISTS (SELECT NULL FROM sys.indexes ...)and deliberately omitsONLINE = ON, because self-hosted runs SQL Server Express (util/Setup/EnvironmentFileBuilder.cs:31), which does not support online index builds.INCLUDE ([Type]): measured identical on both probes, and Pomelo and SQLite ignoreINCLUDE, so the key form is the only one that lands the same shape on all four providers.MAX([LastActivityDate])probe drops to a single backward seek, and carrying[Type]removes the key lookup per device row from the extension probe (36,734 to 16,022 logical reads).dotnet efoutput. Reviewable surface:git diff main... -- . ':!*.Designer.cs'.Deployment note: this runs offline inside DbUp's transaction under a 5 minute timeout (
MigratorConstants.cs:8), andDatabaseMigrationHostedServiceretries 10 times at 20 second intervals. On a production-sizedDevicetable that can block device writes and then fail with no progress. RaiseMigrationExecutionTimeoutSecondsfor the cloud run, or use--no-transaction.Bottom of a 3 PR stack.
data-accesssits on this.📸 Screenshots
No user-visible change.