#1636 speedup for untagged_builds query
Closed: Fixed by tkopecek. Opened by tkopecek.

Currently there is

SELECT build.id, package.name, build.version, build.release
FROM build
    JOIN package on package.id = build.pkg_id
    LEFT OUTER JOIN tag_listing ON tag_listing.build_id = build.id
        AND tag_listing.active IS TRUE
WHERE tag_listing.tag_id IS NULL AND build.state = 1

Better option could be:

SELECT b.id, p.name, b.version, b.release
FROM build b, package p
WHERE
    NOT EXISTS
        (SELECT 1 FROM tag_listing tl
         WHERE tl.build_id = b.id
             AND tl.active = TRUE
        )
    AND p.id = b.pkg_id
    AND b.state = 1

I'm getting half time compared to current query (2.4s vs 4.4s). It probably could be still better.


Metadata Update from @tkopecek:
- Custom field Size adjusted to None
- Issue set to the milestone: 1.26

Metadata Update from @tkopecek:
- Issue set to the milestone: 1.27 (was: 1.26)

PR #3005

Metadata Update from @jcupova:
- Issue tagged with: testing-ready

Metadata Update from @jcupova:
- Issue tagged with: testing-done

Commit b477fa5e fixes this issue

Commit b382032d fixes this issue

This issue has been migrated to Fedora Forge:
https://forge.fedoraproject.org/koji/koji/issues/1636

Please continue any further discussion there.

Metadata
Related Pull Requests