1. 28 Aug, 2008 1 commit
    • Tom Lane's avatar
      Extend the parser location infrastructure to include a location field in · a2794623
      Tom Lane authored
      most node types used in expression trees (both before and after parse
      analysis).  This allows us to place an error cursor in many situations
      where we formerly could not, because the information wasn't available
      beyond the very first level of parse analysis.  There's a fair amount
      of work still to be done to persuade individual ereport() calls to actually
      include an error location, but this gets the initdb-forcing part of the
      work out of the way; and the situation is already markedly better than
      before for complaints about unimplementable implicit casts, such as
      CASE and UNION constructs with incompatible alternative data types.
      Per my proposal of a few days ago.
      a2794623
  2. 26 Aug, 2008 2 commits
  3. 25 Aug, 2008 9 commits
  4. 23 Aug, 2008 3 commits
  5. 22 Aug, 2008 4 commits
    • Bruce Momjian's avatar
      8ddb739e
    • Bruce Momjian's avatar
      Minor patch on pgbench · 6152de97
      Bruce Momjian authored
      1. -i option should run vacuum analyze only on pgbench tables, not *all*
      tables in database.
      
      2. pre-run cleanup step was DELETE FROM HISTORY then VACUUM HISTORY.
      This is just a slow version of TRUNCATE HISTORY.
      
      Simon Riggs
      6152de97
    • Bruce Momjian's avatar
      Improve wording of error message when a postgresql.conf setting is · 03302fd9
      Bruce Momjian authored
      ignored because it can only be set at server start.
      03302fd9
    • Tom Lane's avatar
      Arrange to convert EXISTS subqueries that are equivalent to hashable IN · bd3dadda
      Tom Lane authored
      subqueries into the same thing you'd have gotten from IN (except always with
      unknownEqFalse = true, so as to get the proper semantics for an EXISTS).
      I believe this fixes the last case within CVS HEAD in which an EXISTS could
      give worse performance than an equivalent IN subquery.
      
      The tricky part of this is that if the upper query probes the EXISTS for only
      a few rows, the hashing implementation can actually be worse than the default,
      and therefore we need to make a cost-based decision about which way to use.
      But at the time when the planner generates plans for subqueries, it doesn't
      really know how many times the subquery will be executed.  The least invasive
      solution seems to be to generate both plans and postpone the choice until
      execution.  Therefore, in a query that has been optimized this way, EXPLAIN
      will show two subplans for the EXISTS, of which only one will actually get
      executed.
      
      There is a lot more that could be done based on this infrastructure: in
      particular it's interesting to consider switching to the hash plan if we start
      out using the non-hashed plan but find a lot more upper rows going by than we
      expected.  I have therefore left some minor inefficiencies in place, such as
      initializing both subplans even though we will currently only use one.
      bd3dadda
  6. 21 Aug, 2008 3 commits
  7. 20 Aug, 2008 7 commits
  8. 19 Aug, 2008 6 commits
  9. 18 Aug, 2008 2 commits
  10. 17 Aug, 2008 3 commits
    • Tom Lane's avatar
      Add some defenses against constant-FALSE outer join conditions. Since · 719012e0
      Tom Lane authored
      eval_const_expressions will generally throw away anything that's ANDed with
      constant FALSE, what we're left with given an example like
      
      select * from tenk1 a where (unique1,0) in (select unique2,1 from tenk1 b);
      
      is a cartesian product computation, which is really not acceptable.
      This is a regression in CVS HEAD compared to previous releases, which were
      able to notice the impossible join condition in this case --- though not in
      some related cases that are also improved by this patch, such as
      
      select * from tenk1 a left join tenk1 b on (a.unique1=b.unique2 and 0=1);
      
      Fix by skipping evaluation of the appropriate side of the outer join in
      cases where it's demonstrably unnecessary.
      719012e0
    • Tom Lane's avatar
      Remove prohibition against SubLinks in the WHERE clause of an EXISTS subquery · f2689e42
      Tom Lane authored
      that we're considering pulling up.  I hadn't wanted to think through whether
      that could work during the first pass at this stuff.  However, on closer
      inspection it seems to be safe enough.
      f2689e42
    • Tom Lane's avatar
      Improve sublink pullup code to handle ANY/EXISTS sublinks that are at top · 19e34b62
      Tom Lane authored
      level of a JOIN/ON clause, not only at top level of WHERE.  (However, we
      can't do this in an outer join's ON clause, unless the ANY/EXISTS refers
      only to the nullable side of the outer join, so that it can effectively
      be pushed down into the nullable side.)  Per request from Kevin Grittner.
      
      In passing, fix a bug in the initial implementation of EXISTS pullup:
      it would Assert if the EXIST's WHERE clause used a join alias variable.
      Since we haven't yet flattened join aliases when this transformation
      happens, it's necessary to include join relids in the computed set of
      RHS relids.
      19e34b62