From 23604060f7f4d55c29b19360320b43660272ae5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= <100827540+reneaaron@users.noreply.github.com> Date: Fri, 19 Jan 2024 09:27:15 +0000 Subject: [PATCH] feat: include amount in index (#453) * feat: include amount in index * fix: split migrations into multiple transactions --- ..._amount_to_transaction_entries_index.up.sql | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql diff --git a/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql b/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql new file mode 100644 index 00000000..d6a0aa3b --- /dev/null +++ b/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql @@ -0,0 +1,18 @@ +CREATE INDEX CONCURRENTLY IF NOT EXISTS index_transaction_entries_on_credit_account_id_include_amount + ON public.transaction_entries USING btree + (credit_account_id ASC) + INCLUDE + (amount); + +--bun:split + +CREATE INDEX CONCURRENTLY IF NOT EXISTS index_transaction_entries_on_debit_account_id_include_amount + ON public.transaction_entries USING btree + (debit_account_id ASC) + INCLUDE + (amount); + +--bun:split + +DROP INDEX IF EXISTS index_transaction_entries_on_debit_account_id; +DROP INDEX IF EXISTS index_transaction_entries_on_credit_account_id; \ No newline at end of file