Skip to content
Snippets Groups Projects
Unverified Commit 01af58e4 authored by Cam Saul's avatar Cam Saul Committed by GitHub
Browse files

Add index on QueryExecution card_id + started_at (#19065)

* Add index on QueryExecution card_id + started_at

* Migrations linter shouldn't disallow legacymigrations > 382

* Remove old test
parent f9aef5cb
No related merge requests found
......@@ -7,8 +7,7 @@
(s/def ::legacy-id
;; some legacy IDs are integers and some are strings. so handle either case.
(s/or
:int (s/and int?
#(<= 1 % 382))
:int int?
:string (s/and string?
#(re-matches #"^\d+$" %)
#(<= 1 (Integer/parseUnsignedInt %) 382))))
......
......@@ -159,14 +159,6 @@
(testing "Valid new-style ID"
(is (= :ok
(validate-id "v42.00-000"))))
(testing "Disallow another legacy ID"
;; should disallow either string *or* number
(doseq [id [383 "383"]]
(testing (pr-str id)
(is (thrown-with-msg?
clojure.lang.ExceptionInfo
#"legacy-id"
(validate-id id))))))
(testing "ID that's missing a zero should fail"
(is (thrown-with-msg?
clojure.lang.ExceptionInfo
......
......@@ -8660,6 +8660,20 @@ databaseChangeLog:
- column:
name: moderated_item_id
- changeSet:
id: 383
author: camsaul
comment: Added 0.41.3 -- Add index to QueryExecution card_id + started_at to fix performance issue #19053
changes:
- createIndex:
tableName: query_execution
indexName: idx_query_execution_card_id_started_at
columns:
- column:
name: card_id
- column:
name: started_at
- changeSet:
id: v42.00-000
author: camsaul
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment