1. 27 Jun, 2006 1 commit
    • Tom Lane's avatar
      Create infrastructure for 'MinimalTuple' representation of in-memory · 3f50ba27
      Tom Lane authored
      tuples with less header overhead than a regular HeapTuple, per my
      recent proposal.  Teach TupleTableSlot code how to deal with these.
      As proof of concept, change tuplestore.c to store MinimalTuples instead
      of HeapTuples.  Future patches will expand the concept to other places
      where it is useful.
      3f50ba27
  2. 05 Mar, 2006 1 commit
  3. 25 Dec, 2005 1 commit
    • Bruce Momjian's avatar
      I have added these macros to c.h: · 261114a2
      Bruce Momjian authored
              #define HIGHBIT                 (0x80)
              #define IS_HIGHBIT_SET(ch)      ((unsigned char)(ch) & HIGHBIT)
      
      and removed CSIGNBIT and mapped it uses to HIGHBIT.  I have also added
      uses for IS_HIGHBIT_SET where appropriate.  This change is
      purely for code clarity.
      261114a2
  4. 22 Nov, 2005 1 commit
  5. 20 Nov, 2005 1 commit
  6. 19 Oct, 2005 2 commits
  7. 15 Oct, 2005 1 commit
  8. 21 Mar, 2005 1 commit
    • Tom Lane's avatar
      Convert index-related tuple handling routines from char 'n'/' ' to bool · ee4ddac1
      Tom Lane authored
      convention for isnull flags.  Also, remove the useless InsertIndexResult
      return struct from index AM aminsert calls --- there is no reason for
      the caller to know where in the index the tuple was inserted, and we
      were wasting a palloc cycle per insert to deliver this uninteresting
      value (plus nontrivial complexity in some AMs).
      I forced initdb because of the change in the signature of the aminsert
      routines, even though nothing really looks at those pg_proc entries...
      ee4ddac1
  9. 16 Mar, 2005 1 commit
    • Tom Lane's avatar
      Revise TupleTableSlot code to avoid unnecessary construction and disassembly · f97aebd1
      Tom Lane authored
      of tuples when passing data up through multiple plan nodes.  A slot can now
      hold either a normal "physical" HeapTuple, or a "virtual" tuple consisting
      of Datum/isnull arrays.  Upper plan levels can usually just copy the Datum
      arrays, avoiding heap_formtuple() and possible subsequent nocachegetattr()
      calls to extract the data again.  This work extends Atsushi Ogawa's earlier
      patch, which provided the key idea of adding Datum arrays to TupleTableSlots.
      (I believe however that something like this was foreseen way back in Berkeley
      days --- see the old comment on ExecProject.)  A test case involving many
      levels of join of fairly wide tables (about 80 columns altogether) showed
      about 3x overall speedup, though simple queries will probably not be
      helped very much.
      
      I have also duplicated some code in heaptuple.c in order to provide versions
      of heap_formtuple and friends that use "bool" arrays to indicate null
      attributes, instead of the old convention of "char" arrays containing either
      'n' or ' '.  This provides a better match to the convention used by
      ExecEvalExpr.  While I have not made a concerted effort to get rid of uses
      of the old routines, I think they should be deprecated and eventually removed.
      f97aebd1
  10. 14 Mar, 2005 1 commit
    • Tom Lane's avatar
      Avoid O(N^2) overhead in repeated nocachegetattr calls when columns of · a9b05bdc
      Tom Lane authored
      a tuple are being accessed via ExecEvalVar and the attcacheoff shortcut
      isn't usable (due to nulls and/or varlena columns).  To do this, cache
      Datums extracted from a tuple in the associated TupleTableSlot.
      Also some code cleanup in and around the TupleTable handling.
      Atsushi Ogawa with some kibitzing by Tom Lane.
      a9b05bdc
  11. 27 Jan, 2005 1 commit
  12. 31 Dec, 2004 1 commit
    • PostgreSQL Daemon's avatar
      · 2ff50159
      PostgreSQL Daemon authored
      Tag appropriate files for rc3
      
      Also performed an initial run through of upgrading our Copyright date to
      extend to 2005 ... first run here was very simple ... change everything
      where: grep 1996-2004 && the word 'Copyright' ... scanned through the
      generated list with 'less' first, and after, to make sure that I only
      picked up the right entries ...
      2ff50159
  13. 29 Aug, 2004 2 commits
  14. 05 Jun, 2004 1 commit
    • Tom Lane's avatar
      Make the world very nearly safe for composite-type columns in tables. · ae93e5fd
      Tom Lane authored
      1. Solve the problem of not having TOAST references hiding inside composite
      values by establishing the rule that toasting only goes one level deep:
      a tuple can contain toasted fields, but a composite-type datum that is
      to be inserted into a tuple cannot.  Enforcing this in heap_formtuple
      is relatively cheap and it avoids a large increase in the cost of running
      the tuptoaster during final storage of a row.
      2. Fix some interesting problems in expansion of inherited queries that
      reference whole-row variables.  We never really did this correctly before,
      but it's now relatively painless to solve by expanding the parent's
      whole-row Var into a RowExpr() selecting the proper columns from the
      child.
      If you dike out the preventive check in CheckAttributeType(),
      composite-type columns now seem to actually work.  However, we surely
      cannot ship them like this --- without I/O for composite types, you
      can't get pg_dump to dump tables containing them.  So a little more
      work still to do.
      ae93e5fd
  15. 04 Jun, 2004 1 commit
    • Tom Lane's avatar
      Resurrect heap_deformtuple(), this time implemented as a singly nested · 8f2ea8b7
      Tom Lane authored
      loop over the fields instead of a loop around heap_getattr.  This is
      considerably faster (O(N) instead of O(N^2)) when there are nulls or
      varlena fields, since those prevent use of attcacheoff.  Replace loops
      over heap_getattr with heap_deformtuple in situations where all or most
      of the fields have to be fetched, such as printtup and tuptoaster.
      Profiling done more than a year ago shows that this should be a nice
      win for situations involving many-column tables.
      8f2ea8b7
  16. 01 Apr, 2004 1 commit
    • Tom Lane's avatar
      Replace TupleTableSlot convention for whole-row variables and function · 375369ac
      Tom Lane authored
      results with tuples as ordinary varlena Datums.  This commit does not
      in itself do much for us, except eliminate the horrid memory leak
      associated with evaluation of whole-row variables.  However, it lays the
      groundwork for allowing composite types as table columns, and perhaps
      some other useful features as well.  Per my proposal of a few days ago.
      375369ac
  17. 16 Jan, 2004 1 commit
  18. 29 Nov, 2003 1 commit
    • PostgreSQL Daemon's avatar
      · 969685ad
      PostgreSQL Daemon authored
      $Header: -> $PostgreSQL Changes ...
      969685ad
  19. 25 Sep, 2003 1 commit
  20. 04 Aug, 2003 2 commits
  21. 21 Jul, 2003 1 commit
  22. 27 Sep, 2002 1 commit
  23. 04 Sep, 2002 1 commit
  24. 02 Sep, 2002 1 commit
    • Tom Lane's avatar
      Code review for HeapTupleHeader changes. Add version number to page headers · c7a165ad
      Tom Lane authored
      (overlaying low byte of page size) and add HEAP_HASOID bit to t_infomask,
      per earlier discussion.  Simplify scheme for overlaying fields in tuple
      header (no need for cmax to live in more than one place).  Don't try to
      clear infomask status bits in tqual.c --- not safe to do it there.  Don't
      try to force output table of a SELECT INTO to have OIDs, either.  Get rid
      of unnecessarily complex three-state scheme for TupleDesc.tdhasoids, which
      has already caused one recent failure.  Improve documentation.
      c7a165ad
  25. 25 Aug, 2002 1 commit
    • Tom Lane's avatar
      Clean up comments to be careful about the distinction between variable- · 58de4809
      Tom Lane authored
      width types and varlena types, since with the introduction of CSTRING as
      a more-or-less-real type, these concepts aren't identical.  I've tried to
      use varlena consistently to denote datatypes with typlen = -1, ie, they
      have a length word and are potentially TOASTable; while the term variable
      width covers both varlena and cstring (and, perhaps, someday other types
      with other rules for computing the actual width).  No code changes in this
      commit except for renaming a couple macros.
      58de4809
  26. 24 Aug, 2002 1 commit
    • Tom Lane's avatar
      The cstring datatype can now be copied, passed around, etc. The typlen · 976246cc
      Tom Lane authored
      value '-2' is used to indicate a variable-width type whose width is
      computed as strlen(datum)+1.  Everything that looks at typlen is updated
      except for array support, which Joe Conway is working on; at the moment
      it wouldn't work to try to create an array of cstring.
      976246cc
  27. 20 Jul, 2002 1 commit
    • Bruce Momjian's avatar
      oid is needed, it is added at the end of the struct (after the null · b0f5086e
      Bruce Momjian authored
      bitmap, if present).
      
      Per Tom Lane's suggestion the information whether a tuple has an oid
      or not is carried in the tuple descriptor.  For debugging reasons
      tdhasoid is of type char, not bool.  There are predefined values for
      WITHOID, WITHOUTOID and UNDEFOID.
      
      This patch has been generated against a cvs snapshot from last week
      and I don't expect it to apply cleanly to current sources.  While I
      post it here for public review, I'm working on a new version against a
      current snapshot.  (There's been heavy activity recently; hope to
      catch up some day ...)
      
      This is a long patch;  if it is too hard to swallow, I can provide it
      in smaller pieces:
      
      Part 1:  Accessor macros
      Part 2:  tdhasoid in TupDesc
      Part 3:  Regression test
      Part 4:  Parameter withoid to heap_addheader
      Part 5:  Eliminate t_oid from HeapTupleHeader
      
      Part 2 is the most hairy part because of changes in the executor and
      even in the parser;  the other parts are straightforward.
      
      Up to part 4 the patched postmaster stays binary compatible to
      databases created with an unpatched version.  Part 5 is small (100
      lines) and finally breaks compatibility.
      
      Manfred Koizar
      b0f5086e
  28. 20 Jun, 2002 1 commit
  29. 15 Jun, 2002 1 commit
  30. 27 May, 2002 1 commit
    • Tom Lane's avatar
      Distinguish between MaxHeapAttributeNumber and MaxTupleAttributeNumber, · 3212cf94
      Tom Lane authored
      where the latter is made slightly larger to allow for in-memory tuples
      containing resjunk attributes.  Responds to today's complaint that one
      cannot UPDATE a table containing the allegedly-legal maximum number of
      columns.
      
      Also, apply Manfred Koizar's recent patch to avoid extra alignment padding
      when there is a null bitmap.  This saves bytes in some cases while not
      creating any backward-compatibility problem AFAICS.
      3212cf94
  31. 25 Oct, 2001 1 commit
  32. 23 Aug, 2001 1 commit
  33. 12 Jun, 2001 1 commit
    • Tom Lane's avatar
      Clean up various to-do items associated with system indexes: · 1d584f97
      Tom Lane authored
      pg_database now has unique indexes on oid and on datname.
      pg_shadow now has unique indexes on usename and on usesysid.
      pg_am now has unique index on oid.
      pg_opclass now has unique index on oid.
      pg_amproc now has unique index on amid+amopclaid+amprocnum.
      Remove pg_rewrite's unnecessary index on oid, delete unused RULEOID syscache.
      Remove index on pg_listener and associated syscache for performance reasons
      (caching rows that are certain to change before you need 'em again is
      rather pointless).
      Change pg_attrdef's nonunique index on adrelid into a unique index on
      adrelid+adnum.
      
      Fix various incorrect settings of pg_class.relisshared, make that the
      primary reference point for whether a relation is shared or not.
      IsSharedSystemRelationName() is now only consulted to initialize relisshared
      during initial creation of tables and indexes.  In theory we might now
      support shared user relations, though it's not clear how one would get
      entries for them into pg_class &etc of multiple databases.
      
      Fix recently reported bug that pg_attribute rows created for an index all have
      the same OID.  (Proof that non-unique OID doesn't matter unless it's
      actually used to do lookups ;-))
      
      There's no need to treat pg_trigger, pg_attrdef, pg_relcheck as bootstrap
      relations.  Convert them into plain system catalogs without hardwired
      entries in pg_class and friends.
      
      Unify global.bki and template1.bki into a single init script postgres.bki,
      since the alleged distinction between them was misleading and pointless.
      Not to mention that it didn't work for setting up indexes on shared
      system relations.
      
      Rationalize locking of pg_shadow, pg_group, pg_attrdef (no need to use
      AccessExclusiveLock where ExclusiveLock or even RowExclusiveLock will do).
      Also, hold locks until transaction commit where necessary.
      1d584f97
  34. 22 Mar, 2001 2 commits
  35. 24 Jan, 2001 1 commit
  36. 27 Dec, 2000 1 commit
    • Tom Lane's avatar
      Fix portability problems recently exposed by regression tests on Alphas. · 8609d4ab
      Tom Lane authored
      1. Distinguish cases where a Datum representing a tuple datatype is an OID
      from cases where it is a pointer to TupleTableSlot, and make sure we use
      the right typlen in each case.
      2. Make fetchatt() and related code support 8-byte by-value datatypes on
      machines where Datum is 8 bytes.  Centralize knowledge of the available
      by-value datatype sizes in two macros in tupmacs.h, so that this will be
      easier if we ever have to do it again.
      8609d4ab