1. 01 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up some minor problems exposed by further thought about Panon's bug · 0b370ea7
      Tom Lane authored
      report on old-style functions invoked by RI triggers.  We had a number of
      other places that were being sloppy about which memory context FmgrInfo
      subsidiary data will be allocated in.  Turns out none of them actually
      cause a problem in 7.1, but this is for arcane reasons such as the fact
      that old-style triggers aren't supported anyway.  To avoid getting burnt
      later, I've restructured the trigger support so that we don't keep trigger
      FmgrInfo structs in relcache memory.  Some other related cleanups too:
      it's not really necessary to call fmgr_info at all while setting up
      the index support info in relcache entries, because those ScanKeyEntry
      structs are never used to invoke the functions.  This should speed up
      relcache initialization a tiny bit.
      0b370ea7
  2. 30 May, 2001 1 commit
  3. 18 May, 2001 1 commit
  4. 16 May, 2001 1 commit
  5. 15 May, 2001 2 commits
  6. 14 May, 2001 1 commit
  7. 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
  8. 02 Apr, 2001 1 commit
  9. 22 Mar, 2001 2 commits
  10. 23 Feb, 2001 2 commits
  11. 29 Jan, 2001 1 commit
    • Tom Lane's avatar
      Clean up handling of tuple descriptors so that result-tuple descriptors · 0d54d6ac
      Tom Lane authored
      allocated by plan nodes are not leaked at end of query.  This doesn't
      really matter for normal queries, but it sure does for queries invoked
      repetitively inside SQL functions.  Clean up some other grotty code
      associated with tupdescs, and fix a few other memory leaks exposed by
      tests with simple SQL functions.
      0d54d6ac
  12. 24 Jan, 2001 3 commits
  13. 23 Jan, 2001 1 commit
    • Tom Lane's avatar
      Fix all the places that called heap_update() and heap_delete() without · 786f1a59
      Tom Lane authored
      bothering to check the return value --- which meant that in case the
      update or delete failed because of a concurrent update, you'd not find
      out about it, except by observing later that the transaction produced
      the wrong outcome.  There are now subroutines simple_heap_update and
      simple_heap_delete that should be used anyplace that you're not prepared
      to do the full nine yards of coping with concurrent updates.  In
      practice, that seems to mean absolutely everywhere but the executor,
      because *noplace* else was checking.
      786f1a59
  14. 18 Jan, 2001 2 commits
  15. 22 Dec, 2000 1 commit
  16. 09 Dec, 2000 1 commit
  17. 08 Dec, 2000 1 commit
  18. 16 Nov, 2000 1 commit
  19. 08 Nov, 2000 1 commit
    • Tom Lane's avatar
      Make DROP TABLE rollback-able: postpone physical file delete until commit. · 3908473c
      Tom Lane authored
      (WAL logging for this is not done yet, however.)  Clean up a number of really
      crufty things that are no longer needed now that DROP behaves nicely.  Make
      temp table mapper do the right things when drop or rename affecting a temp
      table is rolled back.  Also, remove "relation modified while in use" error
      check, in favor of locking tables at first reference and holding that lock
      throughout the statement.
      3908473c
  20. 11 Oct, 2000 1 commit
  21. 05 Oct, 2000 1 commit
  22. 14 Jul, 2000 1 commit
    • Tom Lane's avatar
      Cleanup of code for creating index entries. Functional indexes with · 6bfe6403
      Tom Lane authored
      pass-by-ref data types --- eg, an index on lower(textfield) --- no longer
      leak memory during index creation or update.  Clean up a lot of redundant
      code ... did you know that copy, vacuum, truncate, reindex, extend index,
      and bootstrap each basically duplicated the main executor's logic for
      extracting information about an index and preparing index entries?
      Functional indexes should be a little faster now too, due to removal
      of repeated function lookups.
      CREATE INDEX 'opt_type' clause is deimplemented by these changes,
      but I haven't removed it from the parser yet (need to merge with
      Thomas' latest change set first).
      6bfe6403
  23. 12 Jul, 2000 1 commit
  24. 05 Jul, 2000 2 commits
    • Tom Lane's avatar
      Update textin() and textout() to new fmgr style. This is just phase · 40f64064
      Tom Lane authored
      one of updating the whole text datatype, but there are so dang many
      calls of these two routines that it seems worth a separate commit.
      40f64064
    • Jan Wieck's avatar
      Changed TOAST relations to have relkind RELKIND_TOASTVALUE. · 6534444d
      Jan Wieck authored
      Special handling of TOAST relations during VACUUM. TOAST relations
      are vacuumed while the lock on the master table is still active.
      The ANALYZE flag doesn't propagate to their vacuuming because the
      toaster access routines allways use index access ignoring stats, so
      why compute them at all.
      
      Protection of TOAST relations against normal INSERT/UPDATE/DELETE
      while offering SELECT for debugging purposes.
      
      Jan
      6534444d
  25. 04 Jul, 2000 1 commit
    • Tom Lane's avatar
      Make toast-table creation and deletion work somewhat reliably. · cdeca5f5
      Tom Lane authored
      Don't go through pg_exec_query_dest(), but directly to the execution
      routines.  Also, extend parameter lists so that there's no need to
      change the global setting of allowSystemTableMods, a hack that was
      certain to cause trouble in the event of any error.
      cdeca5f5
  26. 30 Jun, 2000 1 commit
    • Tom Lane's avatar
      Use a private memory context to store rule information in each relcache · b41f4ab8
      Tom Lane authored
      entry that has rules.  This allows us to release the rule parsetrees
      on relcache flush without needing a working freeObject() routine.
      Formerly, the rule trees were leaked permanently at relcache flush.
      Also, clean up handling of rule creation and deletion --- there was
      not sufficient locking of the relation being modified, and there was
      no reliable notification of other backends that a relcache reload
      was needed.  Also, clean up relcache.c code so that scans of system
      tables needed to load a relcache entry are done in the caller's
      memory context, not in CacheMemoryContext.  This prevents any
      un-pfreed memory from those scans from becoming a permanent memory
      leak.
      b41f4ab8
  27. 28 Jun, 2000 1 commit
    • Tom Lane's avatar
      First phase of memory management rewrite (see backend/utils/mmgr/README · 1aebc361
      Tom Lane authored
      for details).  It doesn't really do that much yet, since there are no
      short-term memory contexts in the executor, but the infrastructure is
      in place and long-term contexts are handled reasonably.  A few long-
      standing bugs have been fixed, such as 'VACUUM; anything' in a single
      query string crashing.  Also, out-of-memory is now considered a
      recoverable ERROR, not FATAL.
      Eliminate a large amount of crufty, now-dead code in and around
      memory management.
      Fix problem with holding off SIGTRAP, SIGSEGV, etc in postmaster and
      backend startup.
      1aebc361
  28. 18 Jun, 2000 1 commit
    • Tom Lane's avatar
      Reimplement nodeMaterial to use a temporary BufFile (or even memory, if the · 1ee26b77
      Tom Lane authored
      materialized tupleset is small enough) instead of a temporary relation.
      This was something I was thinking of doing anyway for performance, and Jan
      says he needs it for TOAST because he doesn't want to cope with toasting
      noname relations.  With this change, the 'noname table' support in heap.c
      is dead code, and I have accordingly removed it.  Also clean up 'noname'
      plan handling in planner --- nonames are either sort or materialize plans,
      and it seems less confusing to handle them separately under those names.
      1ee26b77
  29. 17 Jun, 2000 3 commits
    • Tom Lane's avatar
      Get rid of IndexIsUniqueNoCache() kluge by the simple expedient of · edf0b5f0
      Tom Lane authored
      passing the index-is-unique flag to index build routines (duh! ...
      why wasn't it done this way to begin with?).  Aside from eliminating
      an eyesore, this should save a few milliseconds in btree index creation
      because a full scan of pg_index is not needed any more.
      edf0b5f0
    • Tom Lane's avatar
      Fix performance problems with pg_index lookups (see, for example, · d03a933e
      Tom Lane authored
      discussion of 5/19/00).  pg_index is now searched for indexes of a
      relation using an indexscan.  Moreover, this is done once and cached
      in the relcache entry for the relation, in the form of a list of OIDs
      for the indexes.  This list is used by the parser and executor to drive
      lookups in the pg_index syscache when they want to know the properties
      of the indexes.  Net result: index information will be fully cached
      for repetitive operations such as inserts.
      d03a933e
    • Tom Lane's avatar
      Clean out another pocket of functions called via nonspecific function · 9cf80f2f
      Tom Lane authored
      pointers, namely the catcache tuple fetch routines.  Also get rid of
      the unused and possibly confusing 'size' field in struct cachedesc.
      Since it doesn't allow for variable-length fields, anyone who
      actually trusted it would likely be making a mistake...
      9cf80f2f
  30. 15 Jun, 2000 1 commit
  31. 08 Jun, 2000 1 commit