chore(documents): drop V61 timeline density index migration (#385)

The index was added in anticipation of a SQL GROUP BY aggregation,
but DocumentService.getDensity aggregates in memory via
findAll(spec).stream(). The index is never touched by the current
query plan. Per Markus's round-2 review: drop the unused migration
to avoid mismatched rationale-vs-implementation debt. Revisit when
the archive crosses 50k rows (TODO already in getDensity Javadoc).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Marcel
2026-05-08 10:49:24 +02:00
parent e5739d7f8e
commit 360db1ae33

View File

@@ -1,9 +0,0 @@
-- Index on documents.meta_date for the timeline density aggregation (issue #385).
-- The new GET /api/documents/density endpoint does GROUP BY date_trunc('month', meta_date)
-- across the full table; an index keeps the aggregation cheap as the archive grows.
-- Cheap to add at any size and removes the future-investigation tax.
--
-- Note: the entity field is `documentDate` but it's mapped to the PostgreSQL column
-- `meta_date` (see Document.java @Column(name = "meta_date")).
CREATE INDEX IF NOT EXISTS idx_documents_meta_date ON documents (meta_date);