Skip to content
  • Mario Oenning's avatar
    perf: tweak some queries in mkpkglists · 5669821b
    Mario Oenning authored
    
    
    We can omit the "distinct" from some queries
    because constraints in the DB ensure uniqueness:
    
    * Groups sub-query
    PackageGroup: Primary key makes "PackageID" + "GroupID" unique
    Groups: Unique index on "Name" column
    -> Technically we can't have a package with the same group-name twice
    
    * Licenses sub-query:
    PackageLicense -> Primary key makes "PackageID" + "LicenseID" unique
    Licenses -> Unique index on "Name" column
    -> Technically we can't have a package with the same license-name twice
    
    * Keywords sub-query:
    PackageKeywords -> Primary key makes "PackageBaseID" + "KeywordID" unique
    (And a Package can only have one PackageBase)
    Keywords -> Unique index on "Name" column
    -> Technically we can't have a package with the same Keyword twice
    
    * Packages main-query:
    We join PackageBases and Users on their primary key columns
    (which are guaranteed to be unique)
    -> There is no way we could end up with more than one record for a Package
    
    Signed-off-by: default avatarmoson-mo <mo-son@mailbox.org>
    5669821b