1. 01 Oct, 2004 1 commit
  2. 29 Aug, 2004 2 commits
  3. 01 Jun, 2004 1 commit
  4. 30 May, 2004 1 commit
  5. 26 May, 2004 1 commit
    • Neil Conway's avatar
      Reimplement the linked list data structure used throughout the backend. · d0b4399d
      Neil Conway authored
      In the past, we used a 'Lispy' linked list implementation: a "list" was
      merely a pointer to the head node of the list. The problem with that
      design is that it makes lappend() and length() linear time. This patch
      fixes that problem (and others) by maintaining a count of the list
      length and a pointer to the tail node along with each head node pointer.
      A "list" is now a pointer to a structure containing some meta-data
      about the list; the head and tail pointers in that structure refer
      to ListCell structures that maintain the actual linked list of nodes.
      
      The function names of the list API have also been changed to, I hope,
      be more logically consistent. By default, the old function names are
      still available; they will be disabled-by-default once the rest of
      the tree has been updated to use the new API names.
      d0b4399d
  6. 04 Jan, 2004 1 commit
    • Tom Lane's avatar
      Rewrite OR indexscan processing to be more flexible. We can now for the · 6cb1c023
      Tom Lane authored
      first time generate an OR indexscan for a two-column index when the WHERE
      condition is like 'col1 = foo AND (col2 = bar OR col2 = baz)' --- before,
      the OR had to be on the first column of the index or we'd not notice the
      possibility of using it.  Some progress towards extracting OR indexscans
      from subclauses of an OR that references multiple relations, too, although
      this code is #ifdef'd out because it needs more work.
      6cb1c023
  7. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  8. 12 Nov, 2003 1 commit
    • Tom Lane's avatar
      Cross-data-type comparisons are now indexable by btrees, pursuant to my · fa5c8a05
      Tom Lane authored
      pghackers proposal of 8-Nov.  All the existing cross-type comparison
      operators (int2/int4/int8 and float4/float8) have appropriate support.
      The original proposal of storing the right-hand-side datatype as part of
      the primary key for pg_amop and pg_amproc got modified a bit in the event;
      it is easier to store zero as the 'default' case and only store a nonzero
      when the operator is actually cross-type.  Along the way, remove the
      long-since-defunct bigbox_ops operator class.
      fa5c8a05
  9. 09 Nov, 2003 1 commit
    • Tom Lane's avatar
      Add operator strategy and comparison-value datatype fields to ScanKey. · c1d62bfd
      Tom Lane authored
      Remove the 'strategy map' code, which was a large amount of mechanism
      that no longer had any use except reverse-mapping from procedure OID to
      strategy number.  Passing the strategy number to the index AM in the
      first place is simpler and faster.
      This is a preliminary step in planned support for cross-datatype index
      operations.  I'm committing it now since the ScanKeyEntryInitialize()
      API change touches quite a lot of files, and I want to commit those
      changes before the tree drifts under me.
      c1d62bfd
  10. 04 Aug, 2003 2 commits
  11. 25 Jul, 2003 1 commit
  12. 29 Jun, 2003 1 commit
    • Tom Lane's avatar
      Restructure building of join relation targetlists so that a join plan · 835bb975
      Tom Lane authored
      node emits only those vars that are actually needed above it in the
      plan tree.  (There were comments in the code suggesting that this was
      done at some point in the dim past, but for a long time we have just
      made join nodes emit everything that either input emitted.)  Aside from
      being marginally more efficient, this fixes the problem noted by Peter
      Eisentraut where a join above an IN-implemented-as-join might fail,
      because the subplan targetlist constructed in the latter case didn't
      meet the expectation of including everything.
      Along the way, fix some places that were O(N^2) in the targetlist
      length.  This is not all the trouble spots for wide queries by any
      means, but it's a step forward.
      835bb975
  13. 28 May, 2003 1 commit
    • Tom Lane's avatar
      Replace functional-index facility with expressional indexes. Any column · fc8d970c
      Tom Lane authored
      of an index can now be a computed expression instead of a simple variable.
      Restrictions on expressions are the same as for predicates (only immutable
      functions, no sub-selects).  This fixes problems recently introduced with
      inlining SQL functions, because the inlining transformation is applied to
      both expression trees so the planner can still match them up.  Along the
      way, improve efficiency of handling index predicates (both predicates and
      index expressions are now cached by the relcache) and fix 7.3 oversight
      that didn't record dependencies of predicate expressions.
      fc8d970c
  14. 12 May, 2003 1 commit
    • Tom Lane's avatar
      Apply fixes for problems with dropped columns whose types have also been · d97c9b36
      Tom Lane authored
      dropped.  The simplest fix for INSERT/UPDATE cases turns out to be for
      preptlist.c to insert NULLs of a known-good type (I used INT4) rather
      than making them match the deleted column's type.  Since the representation
      of NULL is actually datatype-independent, this should work fine.
      I also re-reverted the patch to disable the use_physical_tlist optimization
      in the presence of dropped columns.  It still doesn't look worth the
      trouble to be smarter, if there are no other bugs to fix.
      Added a regression test to catch future problems in this area.
      d97c9b36
  15. 11 May, 2003 2 commits
  16. 09 Feb, 2003 1 commit
  17. 08 Feb, 2003 1 commit
  18. 03 Feb, 2003 1 commit
    • Tom Lane's avatar
      Tweak planner and executor to avoid doing ExecProject() in table scan · 4cff59d8
      Tom Lane authored
      nodes where it's not really necessary.  In many cases where the scan node
      is not the topmost plan node (eg, joins, aggregation), it's possible to
      just return the table tuple directly instead of generating an intermediate
      projection tuple.  In preliminary testing, this reduced the CPU time
      needed for 'SELECT COUNT(*) FROM foo' by about 10%.
      4cff59d8
  19. 28 Jan, 2003 1 commit
  20. 24 Nov, 2002 1 commit
    • Tom Lane's avatar
      Restructure planning of nestloop inner indexscans so that the set of usable · 04c8785c
      Tom Lane authored
      joinclauses is determined accurately for each join.  Formerly, the code only
      considered joinclauses that used all of the rels from the outer side of the
      join; thus for example
      	FROM (a CROSS JOIN b) JOIN c ON (c.f1 = a.x AND c.f2 = b.y)
      could not exploit a two-column index on c(f1,f2), since neither of the
      qual clauses would be in the joininfo list it looked in.  The new code does
      this correctly, and also is able to eliminate redundant clauses, thus fixing
      the problem noted 24-Oct-02 by Hans-Jürgen Schönig.
      04c8785c
  21. 04 Sep, 2002 1 commit
  22. 20 Jun, 2002 1 commit
  23. 20 May, 2002 1 commit
    • Tom Lane's avatar
      Restructure indexscan API (index_beginscan, index_getnext) per · 44fbe20d
      Tom Lane authored
      yesterday's proposal to pghackers.  Also remove unnecessary parameters
      to heap_beginscan, heap_rescan.  I modified pg_proc.h to reflect the
      new numbers of parameters for the AM interface routines, but did not
      force an initdb because nothing actually looks at those fields.
      44fbe20d
  24. 12 Apr, 2002 1 commit
  25. 19 Feb, 2002 1 commit
    • Tom Lane's avatar
      A bunch of changes aimed at reducing backend startup time... · 78634044
      Tom Lane authored
      Improve 'pg_internal.init' relcache entry preload mechanism so that it is
      safe to use for all system catalogs, and arrange to preload a realistic
      set of system-catalog entries instead of only the three nailed-in-cache
      indexes that were formerly loaded this way.  Fix mechanism for deleting
      out-of-date pg_internal.init files: this must be synchronized with transaction
      commit, not just done at random times within transactions.  Drive it off
      relcache invalidation mechanism so that no special-case tests are needed.
      
      Cache additional information in relcache entries for indexes (their pg_index
      tuples and index-operator OIDs) to eliminate repeated lookups.  Also cache
      index opclass info at the per-opclass level to avoid repeated lookups during
      relcache load.
      
      Generalize 'systable scan' utilities originally developed by Hiroshi,
      move them into genam.c, use in a number of places where there was formerly
      ugly code for choosing either heap or index scan.  In particular this allows
      simplification of the logic that prevents infinite recursion between syscache
      and relcache during startup: we can easily switch to heapscans in relcache.c
      when and where needed to avoid recursion, so IndexScanOK becomes simpler and
      does not need any expensive initialization.
      
      Eliminate useless opening of a heapscan data structure while doing an indexscan
      (this saves an mdnblocks call and thus at least one kernel call).
      78634044
  26. 25 Oct, 2001 1 commit
  27. 21 Aug, 2001 1 commit
    • Tom Lane's avatar
      Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions in · f933766b
      Tom Lane authored
      pgsql-hackers.  pg_opclass now has a row for each opclass supported by each
      index AM, not a row for each opclass name.  This allows pg_opclass to show
      directly whether an AM supports an opclass, and furthermore makes it possible
      to store additional information about an opclass that might be AM-dependent.
      pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we
      previously expected the user to remember to provide in CREATE INDEX commands.
      Lossiness is no longer an index-level property, but is associated with the
      use of a particular operator in a particular index opclass.
      
      Along the way, IndexSupportInitialize now uses the syscaches to retrieve
      pg_amop and pg_amproc entries.  I find this reduces backend launch time by
      about ten percent, at the cost of a couple more special cases in catcache.c's
      IndexScanOK.
      
      Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane.
      
      initdb forced.
      f933766b
  28. 15 Jul, 2001 1 commit
    • Tom Lane's avatar
      Restructure index AM interface for index building and index tuple deletion, · c8076f09
      Tom Lane authored
      per previous discussion on pghackers.  Most of the duplicate code in
      different AMs' ambuild routines has been moved out to a common routine
      in index.c; this means that all index types now do the right things about
      inserting recently-dead tuples, etc.  (I also removed support for EXTEND
      INDEX in the ambuild routines, since that's about to go away anyway, and
      it cluttered the code a lot.)  The retail indextuple deletion routines have
      been replaced by a "bulk delete" routine in which the indexscan is inside
      the access method.  I haven't pushed this change as far as it should go yet,
      but it should allow considerable simplification of the internal bookkeeping
      for deletions.  Also, add flag columns to pg_am to eliminate various
      hardcoded tests on AM OIDs, and remove unused pg_am columns.
      
      Fix rtree and gist index types to not attempt to store NULLs; before this,
      gist usually crashed, while rtree managed not to crash but computed wacko
      bounding boxes for NULL entries (which might have had something to do with
      the performance problems we've heard about occasionally).
      
      Add AtEOXact routines to hash, rtree, and gist, all of which have static
      state that needs to be reset after an error.  We discovered this need long
      ago for btree, but missed the other guys.
      
      Oh, one more thing: concurrent VACUUM is now the default.
      c8076f09
  29. 20 May, 2001 1 commit
    • Tom Lane's avatar
      Modify optimizer data structures so that IndexOptInfo lists built for · be03eb25
      Tom Lane authored
      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
  30. 07 May, 2001 1 commit
    • Tom Lane's avatar
      Rewrite of planner statistics-gathering code. ANALYZE is now available as · f905d65e
      Tom Lane authored
      a separate statement (though it can still be invoked as part of VACUUM, too).
      pg_statistic redesigned to be more flexible about what statistics are
      stored.  ANALYZE now collects a list of several of the most common values,
      not just one, plus a histogram (not just the min and max values).  Random
      sampling is used to make the process reasonably fast even on very large
      tables.  The number of values and histogram bins collected is now
      user-settable via an ALTER TABLE command.
      
      There is more still to do; the new stats are not being used everywhere
      they could be in the planner.  But the remaining changes for this project
      should be localized, and the behavior is already better than before.
      
      A not-very-related change is that sorting now makes use of btree comparison
      routines if it can find one, rather than invoking '<' twice.
      f905d65e
  31. 22 Mar, 2001 1 commit
  32. 24 Jan, 2001 1 commit
  33. 16 Nov, 2000 1 commit
  34. 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
  35. 27 Jul, 2000 1 commit
  36. 05 Jul, 2000 1 commit
  37. 20 Jun, 2000 1 commit