From a33811912d4b8268d861d80863d9fbbef5e108bb Mon Sep 17 00:00:00 2001 From: David Whittington Date: Mon, 5 Jun 2023 15:23:20 -0500 Subject: [PATCH] perf(sqlite graphql): add a transaction_id index on new_transaction_tags PE-3769 Since we run a separate query to retrieve tags by transaction_id for each transaction returned, this substantially improves performance when querying new transactions (stable transactions already have a similar index). --- ...5T18.32.29.core.new-transaction-tags-transaction-id-index.sql | 1 + ...5T18.32.29.core.new-transaction-tags-transaction-id-index.sql | 1 + 2 files changed, 2 insertions(+) create mode 100644 migrations/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql create mode 100644 migrations/down/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql diff --git a/migrations/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql b/migrations/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql new file mode 100644 index 00000000..1be99f23 --- /dev/null +++ b/migrations/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql @@ -0,0 +1 @@ +CREATE INDEX IF NOT EXISTS new_transaction_tags_transaction_id_idx ON new_transaction_tags (transaction_id); diff --git a/migrations/down/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql b/migrations/down/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql new file mode 100644 index 00000000..218d81e2 --- /dev/null +++ b/migrations/down/2023.06.05T18.32.29.core.new-transaction-tags-transaction-id-index.sql @@ -0,0 +1 @@ +DROP INDEX IF EXISTS new_transaction_tags_transaction_id_idx;