FEAT: Partitionnement PostgreSQL de la table events + index critiques #18
Labels
No labels
bug
chore
design
dx:ci
dx:database
dx:dotnet
dx:infra
dx:security
dx:tests
dx:ui
etape-1
etape-2
etape-3
etape-4
etape-5
etape-6
etape-7
feature
priority-high
priority-low
priority-medium
security
spec
tech-debt
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
nonobis/Heimdall#18
LoadingâŠ
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
đŻ Contexte
La spec exige un partitionnement de la table events dÚs le jour 1 et des index spécifiques. La table actuelle est une simple table EF Core.
đ RĂ©fĂ©rence spec (MASTER_SPECIFICATION.md v2.0)
2.3 Index PostgreSQL Essentiels :
PARTITION BY RANGE (timestamp)+ partitions mensuelles (via Hangfire ou pg_cron) â Correctif D7idx_events_camera_time (camera_id, timestamp DESC),idx_events_site_time,idx_events_type_time,idx_events_track_id,idx_events_detection_hash,idx_events_parent_id, GINidx_events_metadata(si requĂȘtes Metadata)idx_recordings_cleanup (camera_id, timestamp),idx_recordings_storage_path,idx_agents_heartbeat (site_id, last_heartbeat) WHERE status='Online',idx_persons_unknown (is_unknown, created_at)đ Ătat actuel (vĂ©rifiĂ© dans le code)
Migration InitialCreate : table
eventssimple. Aucun partitionnement, aucun index composite/GIN/partiel défini. (Quelques index EF de base existent via conventions.)𧩠à faire
eventspar RANGE (timestamp)đ§Ș CritĂšres d'acceptation
eventspartitionnĂ©e, partitions mensuelles crééesmake testvert (adaptations requĂȘtes Ă©ventuelles)đ Fichiers concernĂ©s
src/Heimdall.Infrastructure/Migrations/, src/Heimdall.Infrastructure/Data/AppDbContext.cs, src/Heimdall.Infrastructure/BackgroundJobs/JobSetup.cs