From 34f2fca1265836a37fd3309b8719184a8d6696d5 Mon Sep 17 00:00:00 2001 From: dankito Date: Tue, 17 Sep 2024 00:20:22 +0200 Subject: [PATCH] Added indices on bankId and accountId (not senseful in all cases (currently) ) --- .../net/codinux/banking/ui/AccountTransaction.sq | 12 ++++++++++++ .../sqldelight/net/codinux/banking/ui/Bank.sq | 9 +++++++++ 2 files changed, 21 insertions(+) diff --git a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq index 77e8013..e495e45 100644 --- a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq +++ b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/AccountTransaction.sq @@ -53,6 +53,12 @@ CREATE TABLE IF NOT EXISTS AccountTransaction ( isReversal INTEGER AS Boolean NOT NULL ); +CREATE INDEX idx_AccountTransaction_bankId +ON AccountTransaction (bankId); + +CREATE INDEX idx_AccountTransaction_accountId +ON AccountTransaction (accountId); + insertTransaction: INSERT INTO AccountTransaction( @@ -163,6 +169,12 @@ CREATE TABLE IF NOT EXISTS Holding ( buyingDate TEXT ); +CREATE INDEX idx_Holding_bankId +ON Holding (bankId); + +CREATE INDEX idx_Holding_accountId +ON Holding (accountId); + insertHolding: INSERT INTO Holding( diff --git a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/Bank.sq b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/Bank.sq index 5c8c3cc..9d186e7 100644 --- a/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/Bank.sq +++ b/composeApp/src/commonMain/sqldelight/net/codinux/banking/ui/Bank.sq @@ -111,6 +111,9 @@ CREATE TABLE IF NOT EXISTS BankAccount ( includeInAutomaticAccountsUpdate INTEGER AS Boolean NOT NULL ); +CREATE INDEX idx_BankAccount_bankId +ON BankAccount (bankId); + insertBankAccount: INSERT INTO BankAccount( @@ -165,6 +168,9 @@ CREATE TABLE IF NOT EXISTS TanMethod ( allowedTanFormat TEXT NOT NULL ); +CREATE INDEX idx_TanMethod_bankId +ON TanMethod (bankId); + insertTanMethod: INSERT INTO TanMethod( @@ -214,6 +220,9 @@ CREATE TABLE IF NOT EXISTS TanMedium ( validTo TEXT ); +CREATE INDEX idx_TanMedium_bankId +ON TanMedium (bankId); + insertTanMedium: INSERT INTO TanMedium(