From e31450a6e61721637437f05c97d56acb7d4a2172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Aaron?= Date: Thu, 23 Nov 2023 10:12:31 +0100 Subject: [PATCH] feat: include amount in index --- ..._add_amount_to_transaction_entries_index.up.sql | 14 ++++++++++++++ 1 file changed, 14 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..fa089f34 --- /dev/null +++ b/db/migrations/20231123030000_add_amount_to_transaction_entries_index.up.sql @@ -0,0 +1,14 @@ +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); + +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); + +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