1. 20 6月, 2001 1 次提交
  2. 21 5月, 2001 1 次提交
    • T
      Modify optimizer data structures so that IndexOptInfo lists built for · be03eb25
      Tom Lane 提交于
      create_index_paths are not immediately discarded, but are available for
      subsequent planner work.  This allows avoiding redundant syscache lookups
      in several places.  Change interface to operator selectivity estimation
      procedures to allow faster and more flexible estimation.
      Initdb forced due to change of pg_proc entries for selectivity functions!
      be03eb25
  3. 28 3月, 2001 1 次提交
  4. 22 3月, 2001 1 次提交
  5. 08 3月, 2001 1 次提交
  6. 13 2月, 2001 2 次提交
  7. 25 1月, 2001 1 次提交
  8. 17 11月, 2000 1 次提交
    • T
      Change SearchSysCache coding conventions so that a reference count is · a933ee38
      Tom Lane 提交于
      maintained for each cache entry.  A cache entry will not be freed until
      the matching ReleaseSysCache call has been executed.  This eliminates
      worries about cache entries getting dropped while still in use.  See
      my posting to pg-hackers of even date for more info.
      a933ee38
  9. 06 10月, 2000 1 次提交
    • T
      Reimplementation of UNION/INTERSECT/EXCEPT. INTERSECT/EXCEPT now meet the · 05e3d0ee
      Tom Lane 提交于
      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
  10. 30 9月, 2000 1 次提交
    • T
      Subselects in FROM clause, per ISO syntax: FROM (SELECT ...) [AS] alias. · 3a94e789
      Tom Lane 提交于
      (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
  11. 26 9月, 2000 1 次提交
  12. 13 9月, 2000 1 次提交
  13. 24 8月, 2000 1 次提交
  14. 22 8月, 2000 1 次提交
    • T
      fmgr interface mopup work. Use new DatumGetBool and BoolGetDatum · e67ff6b6
      Tom Lane 提交于
      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
  15. 13 8月, 2000 1 次提交
    • T
      Clean up handling of variable-free qual clauses. System now does the · 37168b8d
      Tom Lane 提交于
      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
  16. 08 8月, 2000 1 次提交
    • T
      Remove 'func_tlist' from Func expression nodes, likewise 'param_tlist' · 62e29fe2
      Tom Lane 提交于
      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
  17. 12 7月, 2000 1 次提交
  18. 30 5月, 2000 1 次提交
  19. 29 5月, 2000 1 次提交
  20. 16 4月, 2000 1 次提交
  21. 13 4月, 2000 1 次提交
  22. 04 4月, 2000 1 次提交
    • T
      Fix extremely nasty little bug observed when a sub-SELECT appears in · 1c72a8a3
      Tom Lane 提交于
      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
  23. 21 3月, 2000 1 次提交
    • T
      Restructure planning code so that preprocessing of targetlist and quals · 3ee8f7e2
      Tom Lane 提交于
      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
  24. 20 3月, 2000 1 次提交
  25. 13 3月, 2000 1 次提交
    • T
      Fix performance bug in constant-expression simplifier. After finding · 1879175b
      Tom Lane 提交于
      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
  26. 21 2月, 2000 1 次提交
    • T
      Create a new expression node type RelabelType, which exists solely to · 57b30e8e
      Tom Lane 提交于
      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
  27. 15 2月, 2000 1 次提交
  28. 26 1月, 2000 1 次提交
    • B
      Add: · 5c25d602
      Bruce Momjian 提交于
        * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
      
      to all files copyright Regents of Berkeley.  Man, that's a lot of files.
      5c25d602
  29. 13 12月, 1999 1 次提交
  30. 09 12月, 1999 1 次提交
  31. 23 11月, 1999 1 次提交
  32. 07 10月, 1999 1 次提交
    • T
      Fix planner and rewriter to follow SQL semantics for tables that are · 3eb1c822
      Tom Lane 提交于
      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
  33. 02 10月, 1999 1 次提交
    • T
      Fix make_clause and make_opclause to record valid type info · fc43696d
      Tom Lane 提交于
      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
  34. 26 9月, 1999 1 次提交
    • T
      Implement constant-expression simplification per Bernard · 40f65241
      Tom Lane 提交于
      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
  35. 09 9月, 1999 1 次提交
    • T
      Repair error noticed by Roberto Cornacchia: selectivity code · 51db6455
      Tom Lane 提交于
      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
  36. 26 8月, 1999 2 次提交
    • T
      Clean up some mistakes in handling of uplevel Vars in planner. · 37d20eb8
      Tom Lane 提交于
      Most parts of the planner should ignore, or indeed never even see, uplevel
      Vars because they will be or have been replaced by Params.  There were a
      couple of places that got it wrong though, probably my fault from recent
      changes...
      37d20eb8
    • T
      Revise implementation of SubLinks so that there is a consistent, · 42af56e1
      Tom Lane 提交于
      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
  37. 23 8月, 1999 1 次提交
    • T
      Further planner/optimizer cleanups. Move all set_tlist_references · 78114cd4
      Tom Lane 提交于
      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
  38. 16 8月, 1999 1 次提交
    • T
      Major planner/optimizer revision: get rid of PathOrder node type, · e6381966
      Tom Lane 提交于
      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