Skip to content

Commit

Permalink
Add indexes on workflow_edges and steps tables (#2849)
Browse files Browse the repository at this point in the history
* Add indexes to foreign keys

- Attempting to resolve slow editor loading issues

* Update CHANGELOG

* Make index additions idempotent

* Remove conflict artifact from CHANGELOG.md
  • Loading branch information
rorymckinley authored Jan 27, 2025
1 parent f0f6111 commit acc7f12
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 0 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ and this project adheres to
[#2718](https://github.com/OpenFn/lightning/issues/2718)
- Temporary instrumentation for JobEditor to help identify performance issues.
[#2617](https://github.com/OpenFn/lightning/issues/2617)
- Indexes to foreign keys on `workflow_edges` and `steps` tables to try and
alleviate slow loading of the job editor.
[#2617](https://github.com/OpenFn/lightning/issues/2617)

### Changed

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defmodule Lightning.Repo.Migrations.IndexWorkflowIdOnWorkflowEdges do
use Ecto.Migration

def change do
create_if_not_exists index(:workflow_edges, [:workflow_id])
end
end
7 changes: 7 additions & 0 deletions priv/repo/migrations/20250122110504_index_job_id_on_steps.exs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
defmodule Lightning.Repo.Migrations.IndexJobIdOnSteps do
use Ecto.Migration

def change do
create_if_not_exists index(:steps, [:job_id])
end
end

0 comments on commit acc7f12

Please sign in to comment.