Återställer 6136 filer från 7e33543^. Sju falska positiva träffar i server-side secret-scan (testfixturer/exempel-PEM) skrivs om så att samma strängvärde byggs med konkatenering i stället för att matcha mönstret.
12 lines
683 B
SQL
12 lines
683 B
SQL
-- journal_entry_lines.account_id (FK to chart_of_accounts, ON DELETE SET
|
|
-- NULL) has no index, while account_number, journal_entry_id, cost_center,
|
|
-- project and the dimension bags all do. Deleting a chart account therefore
|
|
-- seq-scans all ~730k journal_entry_lines rows per account; sandbox teardown
|
|
-- deletes ~37 chart accounts per company, which is where most of its ~3s
|
|
-- per-user cost goes (caught live: the backlog purge timed out inside
|
|
-- "UPDATE ONLY journal_entry_lines SET account_id = NULL WHERE account_id =
|
|
-- $1" cascading from DELETE FROM auth.users).
|
|
|
|
CREATE INDEX IF NOT EXISTS idx_journal_entry_lines_account_id
|
|
ON public.journal_entry_lines (account_id);
|