#110515Prevent duplicate dashboard identifiers and improve owner lookups
Description
Dashboard identifiers are currently generated from the preset identifier and the current timestamp with one-second precision. Creating the same preset more than once within a
second can therefore produce duplicate identifiers.
Additionally, dashboards are loaded by cruser_id, but be_dashboards has no corresponding index. This causes full table scans as the table grows.
The change:
- Generates opaque identifiers using random_bytes().
- Adds a unique database constraint for identifier.
- Adds an index for cruser_id.
- Provides an upgrade wizard that replaces existing duplicate identifiers before the unique constraint is created.
A synthetic SQLite benchmark for owner lookups measured:
- 100,000 rows: 3.069 ms → 0.012 ms (approximately 256× faster)
- 10,000 rows: 0.192 ms → 0.010 ms (approximately 19× faster)
Focused tests cover repeated dashboard creation, schema indexes, and migration of existing duplicates.
Reviews 1
Related issues 1
History 24
-
Gerrit Code Review pushed patch set 1 for main to change 95380 status
NewUnder Review <span data-processor="relativetime" data-value="2026-08-21T20:58:18+00:00" > 08/21/26, 20:58 </span> -
Gerrit Code Review pushed patch set 2 for main to change 95380 <span data-processor="relativetime" data-value="2026-09-30T17:35:57+00:00" > 09/30/26, 17:35 </span>
-
Georg Ringer changed Related to #109768 <span data-processor="relativetime" data-value="2026-10-09T08:54:59+00:00" > 10/09/26, 08:54 </span>
-
Wouter Wolters commented and changed status
Under ReviewResolved done0 %100 % <span data-processor="relativetime" data-value="2026-10-12T18:20:13+00:00" > 10/12/26, 18:20 </span>
Applied in changeset commit:519a56f586f8a8750b9420629850b1f90cf69cab.