Skip to content

Commit

Permalink
feat(jdbc): improve logs indexes (#1882)
Browse files Browse the repository at this point in the history
Without this new index, the index on timestamp is always used.
Fixes #1810 as far as we understand the issue.
  • Loading branch information
loicmathieu authored Aug 13, 2023
1 parent 13bf280 commit a6344b4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 0 deletions.
3 changes: 3 additions & 0 deletions jdbc-h2/src/main/resources/migrations/h2/V18_index_logs.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX logs_namespace;
DROP INDEX logs_timestamp;
CREATE INDEX logs_namespace_flow ON logs (deleted, timestamp, level, namespace, flow_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX ix_namespace ON logs;
DROP INDEX ix_timestamp ON logs;
CREATE INDEX ix_namespace_flow ON logs (deleted, timestamp, level, namespace, flow_id);
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
DROP INDEX logs_namespace;
DROP INDEX logs_timestamp;
CREATE INDEX logs_namespace_flow ON logs (deleted, timestamp, level, namespace, flow_id);

0 comments on commit a6344b4

Please sign in to comment.