[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

[Git][ftp-team/dak][master] cruft.py: minor adjustments to improve performance with Postgres 13



Title: GitLab

Ansgar pushed to branch master at Debian FTP Team / dak

Commits:

  • 644bc460
    by Ansgar at 2022-09-25T12:52:17+02:00
    cruft.py: minor adjustments to improve performance with Postgres 13
    

1 changed file:

Changes:

  • daklib/cruft.py
    ... ... @@ -278,7 +278,7 @@ with
    278 278
             from newest_binaries
    
    279 279
             group by architecture, source, version),
    
    280 280
         unique_binaries_uptodate_arch as
    
    281
    -    (select ub.package, ub.architecture, ua.source, ua.version
    
    281
    +    (select ub.package, (select a.arch_string from architecture a where a.id = ub.architecture) as arch_string, ua.source, ua.version
    
    282 282
             from unique_binaries ub
    
    283 283
             join source s
    
    284 284
                 on ub.source = s.id
    
    ... ... @@ -286,18 +286,16 @@ with
    286 286
                 on ub.architecture = ua.architecture and s.source = ua.source),
    
    287 287
         unique_binaries_uptodate_arch_agg as
    
    288 288
         (select ubua.package,
    
    289
    -        array(select unnest(array_agg(a.arch_string)) order by 1) as arch_list,
    
    289
    +        array_agg(ubua.arch_string order by ubua.arch_string) as arch_list,
    
    290 290
             ubua.source, ubua.version
    
    291 291
             from unique_binaries_uptodate_arch ubua
    
    292
    -        join architecture a
    
    293
    -            on ubua.architecture = a.id
    
    294 292
             group by ubua.source, ubua.version, ubua.package),
    
    295 293
         uptodate_packages as
    
    296 294
         (select package, source, version
    
    297 295
             from newest_binaries
    
    298 296
             group by package, source, version),
    
    299 297
         outdated_packages as
    
    300
    -    (select array(select unnest(array_agg(package)) order by 1) as pkg_list,
    
    298
    +    (select array_agg(package order by package) as pkg_list,
    
    301 299
             arch_list, source, version
    
    302 300
             from unique_binaries_uptodate_arch_agg
    
    303 301
             where package not in
    


  • Reply to: