Skip to content

Commit

Permalink
optimize query (#2824)
Browse files Browse the repository at this point in the history
Signed-off-by: sophiely <[email protected]>
Co-authored-by: Peter Hicks <[email protected]>
  • Loading branch information
sophiely and phixMe committed May 29, 2024
1 parent 6a5262b commit b6057c3
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions api/src/main/java/marquez/db/JobDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -62,10 +62,14 @@ SELECT EXISTS (
"""
WITH job_versions_facets AS (
SELECT
job_version_uuid
, JSON_AGG(facet) as facets
f.job_version_uuid
, JSON_AGG(f.facet) as facets
FROM
job_facets
job_facets f
LEFT JOIN
jobs_view j on j.current_version_uuid = f.job_version_uuid
WHERE
j.namespace_name=:namespaceName AND (j.name=:jobName OR :jobName = ANY(j.aliases))
GROUP BY
job_version_uuid
),
Expand Down

0 comments on commit b6057c3

Please sign in to comment.