From 85febbe5a2eeab4463b5463b55dc232f141f2588 Mon Sep 17 00:00:00 2001 From: pacien Date: Sun, 25 Jul 2021 14:20:30 +0200 Subject: sql: add queries (with embrace) --- sql/tables.sql | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'sql/tables.sql') diff --git a/sql/tables.sql b/sql/tables.sql index d56156b..37ffbff 100644 --- a/sql/tables.sql +++ b/sql/tables.sql @@ -41,3 +41,9 @@ create table transactions ( (operation in ('fee', 'withdrawal') or recipient is not null), amount simoleon not null check (amount > 0) ); + +-- Additional indexes for the financial transaction log for the common +-- participant-centered queries. Those also include the datetime column, which +-- is useful for paginating the log. +create index transaction_source_index on transactions (source, datetime); +create index transaction_recipient_index on transactions (recipient, datetime); -- cgit v1.2.3