1. 27 Mar, 2001 1 commit
  2. 22 Mar, 2001 1 commit
  3. 08 Mar, 2001 1 commit
  4. 12 Feb, 2001 2 commits
  5. 24 Jan, 2001 1 commit
  6. 16 Nov, 2000 1 commit
  7. 05 Oct, 2000 1 commit
    • Tom Lane's avatar
      Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the · 05e3d0ee
      Tom Lane authored
      SQL92 semantics, including support for ALL option.  All three can be used
      in subqueries and views.  DISTINCT and ORDER BY work now in views, too.
      This rewrite fixes many problems with cross-datatype UNIONs and INSERT/SELECT
      where the SELECT yields different datatypes than the INSERT needs.  I did
      that by making UNION subqueries and SELECT in INSERT be treated like
      subselects-in-FROM, thereby allowing an extra level of targetlist where the
      datatype conversions can be inserted safely.
      INITDB NEEDED!
      05e3d0ee
  8. 29 Sep, 2000 1 commit
    • Tom Lane's avatar
      Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias. · 3a94e789
      Tom Lane authored
      (Don't forget that an alias is required.)  Views reimplemented as expanding
      to subselect-in-FROM.  Grouping, aggregates, DISTINCT in views actually
      work now (he says optimistically).  No UNION support in subselects/views
      yet, but I have some ideas about that.  Rule-related permissions checking
      moved out of rewriter and into executor.
      INITDB REQUIRED!
      3a94e789
  9. 25 Sep, 2000 1 commit
  10. 12 Sep, 2000 1 commit
  11. 24 Aug, 2000 1 commit
  12. 21 Aug, 2000 1 commit
    • Tom Lane's avatar
      fmgr interface mopup work. Use new DatumGetBool and BoolGetDatum · e67ff6b6
      Tom Lane authored
      macros where appropriate (the code used to have several different ways
      of doing that, including Int32, Int8, UInt8, ...).  Remove last few
      references to float32 and float64 typedefs --- it's all float4/float8
      now.  The typedefs themselves should probably stay in c.h for a release
      or two, though, to avoid breaking user-written C functions.
      e67ff6b6
  13. 13 Aug, 2000 1 commit
    • Tom Lane's avatar
      Clean up handling of variable-free qual clauses. System now does the · 37168b8d
      Tom Lane authored
      right thing with variable-free clauses that contain noncachable functions,
      such as 'WHERE random() < 0.5' --- these are evaluated once per
      potential output tuple.  Expressions that contain only Params are
      now candidates to be indexscan quals --- for example, 'var = ($1 + 1)'
      can now be indexed.  Cope with RelabelType nodes atop potential indexscan
      variables --- this oversight prevents 7.0.* from recognizing some
      potentially indexscanable situations.
      37168b8d
  14. 08 Aug, 2000 1 commit
    • Tom Lane's avatar
      Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist' · 62e29fe2
      Tom Lane authored
      from Param nodes, per discussion a few days ago on pghackers.  Add new
      expression node type FieldSelect that implements the functionality where
      it's actually needed.  Clean up some other unused fields in Func nodes
      as well.
      NOTE: initdb forced due to change in stored expression trees for rules.
      62e29fe2
  15. 12 Jul, 2000 1 commit
  16. 30 May, 2000 1 commit
  17. 28 May, 2000 1 commit
  18. 16 Apr, 2000 1 commit
  19. 12 Apr, 2000 1 commit
  20. 04 Apr, 2000 1 commit
    • Tom Lane's avatar
      Fix extremely nasty little bug observed when a sub-SELECT appears in · 1c72a8a3
      Tom Lane authored
      WHERE in a place where it can be part of a nestloop inner indexqual.
      As the code stood, it put the same physical sub-Plan node into both
      indxqual and indxqualorig of the IndexScan plan node.  That confused
      later processing in the optimizer (which expected that tracing the
      subPlan list would visit each subplan node exactly once), and would
      probably have blown up in the executor if the planner hadn't choked first.
      Fix by making the 'fixed' indexqual be a complete deep copy of the
      original indexqual, rather than trying to share nodes below the topmost
      operator node.  This had further ramifications though, because we were
      making the aforesaid list of sub-Plan nodes during SS_process_sublinks
      which is run before construction of the 'fixed' indexqual, meaning that
      the copy of the sub-Plan didn't show up in that list.  Fix by rearranging
      logic so that the sub-Plan list is built by the final set_plan_references
      pass, not in SS_process_sublinks.  This may sound like a mess, but it's
      actually a good deal cleaner now than it was before, because we are no
      longer dependent on the assumption that planning will never make a copy
      of a sub-Plan node.
      1c72a8a3
  21. 21 Mar, 2000 1 commit
    • Tom Lane's avatar
      Restructure planning code so that preprocessing of targetlist and quals · 3ee8f7e2
      Tom Lane authored
      to simplify constant expressions and expand SubLink nodes into SubPlans
      is done in a separate routine subquery_planner() that calls union_planner().
      We formerly did most of this work in query_planner(), but that's the
      wrong place because it may never see the real targetlist.  Splitting
      union_planner into two routines also allows us to avoid redundant work
      when union_planner is invoked recursively for UNION and inheritance
      cases.  Upshot is that it is now possible to do something like
      select float8(count(*)) / (select count(*) from int4_tbl)  from int4_tbl
      group by f1;
      which has never worked before.
      3ee8f7e2
  22. 19 Mar, 2000 1 commit
  23. 12 Mar, 2000 1 commit
    • Tom Lane's avatar
      Fix performance bug in constant-expression simplifier. After finding · 1879175b
      Tom Lane authored
      that the inputs to a given operator can be recursively simplified to
      constants, it was evaluating the operator using the op's *original*
      (unsimplified) arg list, so that any subexpressions had to be evaluated
      again.  A constant subexpression at depth N got evaluated N times.
      Probably not very important in practical situations, but it made us look
      real slow in MySQL's 'crashme' test...
      1879175b
  24. 20 Feb, 2000 1 commit
    • Tom Lane's avatar
      Create a new expression node type RelabelType, which exists solely to · 57b30e8e
      Tom Lane authored
      represent the result of a binary-compatible type coercion.  At runtime
      it just evaluates its argument --- but during type resolution, exprType
      will pick up the output type of the RelabelType node instead of the type
      of the argument.  This solves some longstanding problems with dropped
      type coercions, an example being 'select now()::abstime::int4' which
      used to produce date-formatted output, not an integer, because the
      coercion to int4 was dropped on the floor.
      57b30e8e
  25. 15 Feb, 2000 1 commit
  26. 26 Jan, 2000 1 commit
    • Bruce Momjian's avatar
      Add: · 5c25d602
      Bruce Momjian authored
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  27. 13 Dec, 1999 1 commit
  28. 09 Dec, 1999 1 commit
  29. 22 Nov, 1999 1 commit
  30. 07 Oct, 1999 1 commit
    • Tom Lane's avatar
      Fix planner and rewriter to follow SQL semantics for tables that are · 3eb1c822
      Tom Lane authored
      mentioned in FROM but not elsewhere in the query: such tables should be
      joined over anyway.  Aside from being more standards-compliant, this allows
      removal of some very ugly hacks for COUNT(*) processing.  Also, allow
      HAVING clause without aggregate functions, since SQL does.  Clean up
      CREATE RULE statement-list syntax the same way Bruce just fixed the
      main stmtmulti production.
      CAUTION: addition of a field to RangeTblEntry nodes breaks stored rules;
      you will have to initdb if you have any rules.
      3eb1c822
  31. 02 Oct, 1999 1 commit
    • Tom Lane's avatar
      Fix make_clause and make_opclause to record valid type info · fc43696d
      Tom Lane authored
      in the Expr nodes they produce.  This fixes a few cases of errors like
      'typeidTypeRelid: Invalid type - oid = 0' caused by calling parser-related
      routines on expression trees that have already been processed by planner-
      related routines.
      fc43696d
  32. 26 Sep, 1999 1 commit
    • Tom Lane's avatar
      Implement constant-expression simplification per Bernard · 40f65241
      Tom Lane authored
      Frankpitt, plus some improvements from yours truly.  The simplifier depends
      on the proiscachable field of pg_proc to tell it whether a function is
      safe to pre-evaluate --- things like nextval() are not, for example.
      Update pg_proc.h to contain reasonable cacheability information; as of
      6.5.* hardly any functions were marked cacheable.  I may have erred too
      far in the other direction; see recent mail to pghackers for more info.
      This update does not force an initdb, exactly, but you won't see much
      benefit from the simplifier until you do one.
      40f65241
  33. 09 Sep, 1999 1 commit
    • Tom Lane's avatar
      Repair error noticed by Roberto Cornacchia: selectivity code · 51db6455
      Tom Lane authored
      was rejecting negative attnums as bogus, which of course they are not.
      Add code to get_attdisbursion to produce a useful value for OID attribute,
      since VACUUM does not store stats for system attributes.
      Also, repair bug that's been in eqjoinsel for a long time: it was taking
      the max of the two columns' disbursions, whereas it should use the min.
      51db6455
  34. 26 Aug, 1999 1 commit
  35. 25 Aug, 1999 1 commit
    • Tom Lane's avatar
      Revise implementation of SubLinks so that there is a consistent, · 42af56e1
      Tom Lane authored
      documented intepretation of the lefthand and oper fields.  Fix a number of
      obscure problems while at it --- for example, the old code failed if the parser
      decided to insert a type-coercion function just below the operator of a
      SubLink.
      CAUTION: this will break stored rules that contain subplans.  You may
      need to initdb.
      42af56e1
  36. 22 Aug, 1999 1 commit
    • Tom Lane's avatar
      Further planner/optimizer cleanups. Move all set_tlist_references · 78114cd4
      Tom Lane authored
      and fix_opids processing to a single recursive pass over the plan tree
      executed at the very tail end of planning, rather than haphazardly here
      and there at different places.  Now that tlist Vars do not get modified
      until the very end, it's possible to get rid of the klugy var_equal and
      match_varid partial-matching routines, and just use plain equal()
      throughout the optimizer.  This is a step towards allowing merge and
      hash joins to be done on expressions instead of only Vars ...
      78114cd4
  37. 16 Aug, 1999 1 commit
    • Tom Lane's avatar
      Major planner/optimizer revision: get rid of PathOrder node type, · e6381966
      Tom Lane authored
      store all ordering information in pathkeys lists (which are now lists of
      lists of PathKeyItem nodes, not just lists of lists of vars).  This was
      a big win --- the code is smaller and IMHO more understandable than it
      was, even though it handles more cases.  I believe the node changes will
      not force an initdb for anyone; planner nodes don't show up in stored
      rules.
      e6381966
  38. 12 Aug, 1999 1 commit
    • Tom Lane's avatar
      Clean up optimizer's handling of indexscan quals that need to be · 8f9f6e51
      Tom Lane authored
      commuted (ie, the index var appears on the right).  These are now handled
      the same way as merge and hash join quals that need to be commuted: the
      actual reversing of the clause only happens if we actually choose the path
      and generate a plan from it.  Furthermore, the clause is only reversed in
      the 'indexqual' field of the plan, not in the 'indxqualorig' field.  This
      allows the clause to still be recognized and removed from qpquals of upper
      level join plans.  Also, simplify and generalize match_clause_to_indexkey;
      now it recognizes binary-compatible indexes for join as well as restriction
      clauses.
      8f9f6e51
  39. 10 Aug, 1999 1 commit