Overview
src/email-marketing/entities/ab-test.entity.ts declares no @Index. Columns that are used for lookups, filtering, sorting, or as foreign keys are therefore unindexed, forcing sequential scans as the table grows. Add appropriate indexes (and a migration that creates them) so the common query paths for this entity stay performant.
Specifications
Features:
- Frequently-queried columns and foreign keys on this entity are indexed.
- The indexes are created by a reviewable migration rather than only
synchronize.
Tasks:
- Review the query paths that hit
ab-test and identify the columns used in WHERE / ORDER BY / JOIN / foreign-key lookups.
- Add
@Index decorators (single-column or composite as appropriate) to src/email-marketing/entities/ab-test.entity.ts.
- Add a migration that creates the same indexes so existing databases are updated.
Impacted Files:
- src/email-marketing/entities/ab-test.entity.ts
- src/migrations/-add-ab-test-indexes.ts
Acceptance Criteria
- The entity carries indexes covering its common lookup/foreign-key columns.
- A migration creates the indexes and runs cleanly on an existing database.
- No duplicate/redundant indexes are introduced.
Overview
src/email-marketing/entities/ab-test.entity.tsdeclares no@Index. Columns that are used for lookups, filtering, sorting, or as foreign keys are therefore unindexed, forcing sequential scans as the table grows. Add appropriate indexes (and a migration that creates them) so the common query paths for this entity stay performant.Specifications
Features:
synchronize.Tasks:
ab-testand identify the columns used in WHERE / ORDER BY / JOIN / foreign-key lookups.@Indexdecorators (single-column or composite as appropriate) tosrc/email-marketing/entities/ab-test.entity.ts.Impacted Files:
Acceptance Criteria