1. 19 Jun, 2017 4 commits
    • Tom Lane's avatar
      Avoid regressions in foreign-key-based selectivity estimates. · d8e6b84b
      Tom Lane authored
      David Rowley found that the "use the smallest per-column selectivity"
      heuristic applied in some cases by get_foreign_key_join_selectivity()
      was badly off if the FK columns are independent, producing estimates
      much worse than we got before that code was added in 9.6.
      
      One case where that heuristic was used was for LEFT and FULL outer joins
      with the referenced rel on the outside of the join.  But we should not
      really need to special-case those here.  eqjoinsel() never has had such a
      special case; the correction is applied by calc_joinrel_size_estimate()
      instead.  Let's just estimate such cases like inner joins and rely on that
      later adjustment.  (I think there was something of a thinko here, in that
      the comments seem to be thinking about the selectivity as defined for
      semi/anti joins; but that shouldn't apply to left/full joins.)  Add a
      regression test exercising such a case to show that this is sane in
      at least some cases.
      
      The other case where we used that heuristic was for SEMI/ANTI outer joins,
      either if the referenced rel was on the outside, or if it was on the inside
      but was part of a join within the RHS.  In either case, the FK doesn't give
      us a lot of traction towards estimating the selectivity.  To ensure that
      we don't have regressions from what happened before 9.6, let's punt by
      ignoring the FK in such cases and applying the traditional selectivity
      calculation.  (We might be able to improve on that later, but for now
      I just want to be sure it's not worse than 9.5.)
      
      Report and patch by David Rowley, simplified a bit by me.  Back-patch
      to 9.6 where this code was added.
      
      Discussion: https://postgr.es/m/CAKJS1f8NO8oCDcxrteohG6O72uU1saEVT9qX=R8pENr5QWerXw@mail.gmail.com
      d8e6b84b
    • Tom Lane's avatar
      On Windows, make pg_dump use binary mode for compressed plain text output. · bd61d5a1
      Tom Lane authored
      The combination of -Z -Fp and output to stdout resulted in corrupted
      output data, because we left stdout in text mode, resulting in newline
      conversion being done on the compressed stream.  Switch stdout to binary
      mode for this case, at the same place where we do it for non-text output
      formats.
      
      Report and patch by Kuntal Ghosh, tested by Ashutosh Sharma and Neha
      Sharma.  Back-patch to all supported branches.
      
      Discussion: https://postgr.es/m/CAGz5QCJPvbBjXAmJuGx1B_41yVCetAJhp7rtaDf7XQGWuB1GSw@mail.gmail.com
      bd61d5a1
    • Andres Freund's avatar
      Fix leaking of small spilled subtransactions during logical decoding. · 3bdea167
      Andres Freund authored
      When, during logical decoding, a transaction gets too big, it's
      contents get spilled to disk. Not just the top-transaction gets
      spilled, but *also* all of its subtransactions, even if they're not
      that large themselves.  Unfortunately we didn't clean up
      such small spilled subtransactions from disk.
      
      Fix that, by keeping better track of whether a transaction has been
      spilled to disk.
      
      Author: Andres Freund
      Reported-By: Dmitriy Sarafannikov, Fabrízio de Royes Mello
      Discussion:
          https://postgr.es/m/1457621358.355011041@f382.i.mail.ru
          https://postgr.es/m/CAFcNs+qNMhNYii4nxpO6gqsndiyxNDYV0S=JNq0v_sEE+9PHXg@mail.gmail.com
      Backpatch: 9.4-, where logical decoding was introduced
      3bdea167
    • Tatsuo Ishii's avatar
      Improve PostgreSQL 10.0 release note regarding pg_current_logfile(). · b4166a8d
      Tatsuo Ishii authored
      Author: Yugo Nagata
      b4166a8d
  2. 18 Jun, 2017 2 commits
  3. 17 Jun, 2017 8 commits
  4. 16 Jun, 2017 5 commits
  5. 15 Jun, 2017 10 commits
  6. 14 Jun, 2017 11 commits