• T
    Rethink representation of index clauses' mapping to index columns. · 472d3935
    Tom Lane 提交于
    In commit e2c2c2e8 I made use of nested
    list structures to show which clauses went with which index columns, but
    on reflection that's a data structure that only an old-line Lisp hacker
    could love.  Worse, it adds unnecessary complication to the many places
    that don't much care which clauses go with which index columns.  Revert
    to the previous arrangement of flat lists of clauses, and instead add a
    parallel integer list of column numbers.  The places that care about the
    pairing can chase both lists with forboth(), while the places that don't
    care just examine one list the same as before.
    
    The only real downside to this is that there are now two more lists that
    need to be passed to amcostestimate functions in case they care about
    column matching (which btcostestimate does, so not passing the info is not
    an option).  Rather than deal with 11-argument amcostestimate functions,
    pass just the IndexPath and expect the functions to extract fields from it.
    That gets us down to 7 arguments which is better than 11, and it seems
    more future-proof against likely additions to the information we keep
    about an index path.
    472d3935
paths.h 6.6 KB