Skip to content

Commit

Permalink
Remove materialized option from Basic.fetch_jobs/3
Browse files Browse the repository at this point in the history
The `MATERIALIZED` clause for CTEs didn't make a meaningful difference
in job fetching accuracy. In some situations it caused a performance
regression (which is why it was removed from Pro's Smart engine a while
ago).
  • Loading branch information
sorentwo committed Jul 12, 2024
1 parent 00ddc10 commit e63d60d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/oban/engines/basic.ex
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ defmodule Oban.Engines.Basic do
# of the CTE, e.g. "public"."subset".
query =
Job
|> with_cte("subset", as: ^subset_query, materialized: true)
|> with_cte("subset", as: ^subset_query)
|> join(:inner, [j], x in fragment(~s("subset")), on: true)
|> where([j, x], j.id == x.id)
|> where([j, _], j.attempt < j.max_attempts)
Expand Down

0 comments on commit e63d60d

Please sign in to comment.