1. 19 Dec, 2019 6 commits
  2. 18 Dec, 2019 11 commits
  3. 17 Dec, 2019 14 commits
  4. 16 Dec, 2019 6 commits
  5. 15 Dec, 2019 1 commit
  6. 14 Dec, 2019 2 commits
    • Tom Lane's avatar
      Try to stabilize results of new tuplesort regression test. · baa32ce2
      Tom Lane authored
      It appears that a concurrent autovacuum/autoanalyze run can cause
      changes in the plans expected by this test.  To prevent that, change
      the tables it uses to be temp tables --- there's no need for them
      to be permanent, and this should save a few cycles too.
      
      Discussion: https://postgr.es/m/3244.1576160824@sss.pgh.pa.us
      baa32ce2
    • Tom Lane's avatar
      Prevent overly-aggressive collapsing of joins to RTE_RESULT relations. · 6ea364e7
      Tom Lane authored
      The RTE_RESULT simplification logic added by commit 4be058fe had a
      flaw: it would collapse out a RTE_RESULT that is due to compute a
      PlaceHolderVar, and reassign the PHV to the parent join level, even if
      another input relation of the join contained a lateral reference to
      the PHV.  That can't work because the PHV would be computed too late.
      In practice it led to failures of internal sanity checks later in
      planning (either assertion failures or errors such as "failed to
      construct the join relation").
      
      To fix, add code to check for the presence of such PHVs in relevant
      portions of the query tree.  Notably, this required refactoring
      range_table_walker so that a caller could ask to walk individual RTEs
      not the whole list.  (It might be a good idea to refactor
      range_table_mutator in the same way, if only to keep those functions
      looking similar; but I didn't do so here as it wasn't necessary for
      the bug fix.)
      
      This exercise also taught me that find_dependent_phvs(), as it stood,
      could only safely be used on the entire Query, not on subtrees.
      Adjust its API to reflect that; which in passing allows it to have
      a fast path for the common case of no PHVs anywhere.
      
      Per report from Will Leinweber.  Back-patch to v12 where the bug
      was introduced.
      
      Discussion: https://postgr.es/m/CALLb-4xJMd4GZt2YCecMC95H-PafuWNKcmps4HLRx2NHNBfB4g@mail.gmail.com
      6ea364e7