Skip to content

Commit 2f41c04

Browse files
committed
optimize joins
1 parent 4ffef73 commit 2f41c04

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/algora/jobs/jobs.ex

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ defmodule Algora.Jobs do
2626
|> join(:inner, [j], u in User, on: u.id == j.user_id)
2727
|> maybe_filter_by_handle(opts[:handle])
2828
|> maybe_filter_by_tech_stack(opts[:tech_stack])
29-
|> join(:left, [j], i in JobInterview, on: i.job_posting_id == j.id)
30-
|> join(:left, [j], m in JobMatch, on: m.job_posting_id == j.id)
29+
|> join(:left, [j], i in JobInterview, on: i.job_posting_id == j.id and i.status not in [:initial])
30+
|> join(:left, [j], m in JobMatch, on: m.job_posting_id == j.id and m.status not in [:pending, :discarded])
3131
|> group_by([j, u, i, m], [u.contract_signed, j.id, j.inserted_at])
3232
|> order_by([j, u, i, m],
3333
desc: u.contract_signed,

0 commit comments

Comments
 (0)