• Tom Lane's avatar
    Fix O(N^2) behavior in pg_dump for large numbers of owned sequences. · 0d8117ab
    Tom Lane authored
    The loop that matched owned sequences to their owning tables required time
    proportional to number of owned sequences times number of tables; although
    this work was only expended in selective-dump situations, which is probably
    why the issue wasn't recognized long since.  Refactor slightly so that we
    can perform this work after the index array for findTableByOid has been
    set up, reducing the time to O(M log N).
    
    Per gripe from Mike Roest.  Since this is a longstanding performance bug,
    backpatch to all supported versions.
    0d8117ab
common.c 22.5 KB