Skip to content
Snippets Groups Projects
  1. Mar 01, 2006
    • Neil Conway's avatar
      Attached is a patch that replaces a bunch of places where StringInfos · 0d9742f9
      Neil Conway authored
      are unnecessarily allocated on the heap rather than the stack. If the
      StringInfo doesn't outlive the stack frame in which it is created,
      there is no need to allocate it on the heap via makeStringInfo() --
      stack allocation is faster.  While it's not a big deal unless the
      code is in a critical path, I don't see a reason not to save a few
      cycles -- using stack allocation is not less readable.
      
      I also cleaned up a bit of code along the way: moved variable
      declarations into a more tightly-enclosing scope where possible,
      fixed some pointless copying of strings in dblink, etc.
      0d9742f9
  2. Feb 28, 2006
    • Tom Lane's avatar
      Allow the syntax CREATE TYPE foo, with no parameters, to permit explicit · 8e68d783
      Tom Lane authored
      creation of a shell type.  This allows a less hacky way of dealing with
      the mutual dependency between a datatype and its I/O functions: make a
      shell type, then make the functions, then define the datatype fully.
      We should fix pg_dump to handle things this way, but this commit just deals
      with the backend.
      
      Martijn van Oosterhout, with some corrections by Tom Lane.
      8e68d783
  3. Feb 27, 2006
  4. Feb 26, 2006
  5. Feb 24, 2006
  6. Feb 19, 2006
    • Tom Lane's avatar
      Update obsolete comment. · 21e2544a
      Tom Lane authored
      21e2544a
    • Tom Lane's avatar
      Modify logtape.c so that the initial LogicalTapeSetCreate call only · b34aa337
      Tom Lane authored
      allocates the control data.  The per-tape buffers are allocated only
      on first use.  This saves memory in situations where tuplesort.c
      overestimates the number of tapes needed (ie, there are fewer runs
      than tapes).  Also, this makes legitimate the coding in inittapes()
      that includes tape buffer space in the maximum-memory calculation:
      when inittapes runs, we've already expended the whole allowed memory
      on tuple storage, and so we'd better not allocate all the tape buffers
      until we've flushed some tuples out of memory.
      b34aa337
    • Tom Lane's avatar
      Improve tuplesort.c to support variable merge order. The original coding · df700e6b
      Tom Lane authored
      with fixed merge order (fixed number of "tapes") was based on obsolete
      assumptions, namely that tape drives are expensive.  Since our "tapes"
      are really just a couple of buffers, we can have a lot of them given
      adequate workspace.  This allows reduction of the number of merge passes
      with consequent savings of I/O during large sorts.
      
      Simon Riggs with some rework by Tom Lane
      df700e6b
  7. Feb 18, 2006
    • Peter Eisentraut's avatar
      Add support for Windows codepages 1253, 1254, 1255, and 1257 and clean · 1b658473
      Peter Eisentraut authored
      up a bunch of the support utilities.
      
      In src/backend/utils/mb/Unicode remove nearly duplicate copies of the
      UCS_to_XXX perl script and replace with one version to handle all generic
      files.  Update the Makefile so that it knows about all the map files.
      This produces a slight difference in some of the map files, using a
      uniform naming convention and not mapping the null character.
      
      In src/backend/utils/mb/conversion_procs create a master utf8<->win
      codepage function like the ISO 8859 versions instead of having a separate
      handler for each conversion.
      
      There is an externally visible change in the name of the win1258 to utf8
      conversion.  According to the documentation notes, it was named
      incorrectly and this changes it to a standard name.
      
      Running the Unicode mapping perl scripts has shown some additional mapping
      changes in koi8r and iso8859-7.
      1b658473
  8. Feb 14, 2006
  9. Feb 13, 2006
  10. Feb 12, 2006
  11. Feb 11, 2006
  12. Feb 10, 2006
    • Tom Lane's avatar
      Change search for default operator classes so that it examines all opclasses · 3ac1ac58
      Tom Lane authored
      regardless of the current schema search path.  Since CREATE OPERATOR CLASS
      only allows one default opclass per datatype regardless of schemas, this
      should have minimal impact, and it fixes problems with failure to find a
      desired opclass while restoring dump files.  Per discussion at
      http://archives.postgresql.org/pgsql-hackers/2006-02/msg00284.php.
      Remove now-redundant-or-unused code in typcache.c and namespace.c,
      and backpatch as far as 8.0.
      3ac1ac58
    • Bruce Momjian's avatar
      Allow psql multi-line column values to align in the proper columns · c01999a5
      Bruce Momjian authored
        If the second output column value is 'a\nb', the 'b' should appear
        in the second display column, rather than the first column as it
        does now.
      
      Change libpq's PQdsplen() to return more useful values.
      
      > Note: this changes the PQdsplen function, it can now return zero or
      > minus one which was not possible before. It doesn't appear anyone is
      > actually using the functions other than psql but it is a change. The
      > functions are not actually documentated anywhere so it's not like we're
      > breaking a defined interface. The new semantics follow the Unicode
      > standard.
      
      BACKWARD COMPATIBLE CHANGE.
      
      The only user-visible change I saw in the regression tests is that a
      SELECT * on a table where all the columns have been dropped doesn't
      return a blank line like before.  This seems like a step forward.
      
      Martijn van Oosterhout
      c01999a5
  13. Feb 09, 2006
  14. Feb 07, 2006
    • Bruce Momjian's avatar
      Source code cleanup. · ad177f10
      Bruce Momjian authored
      ad177f10
    • Bruce Momjian's avatar
      I think that NUMERIC datatype has a problem in the performance that · e7a9ccdb
      Bruce Momjian authored
      the format on Tuple(Numeric) and the format to calculate(NumericVar)
      are different. I understood that to reduce I/O. However, when many
      comparisons or calculations of NUMERIC are executed, the conversion
      of Numeric and NumericVar becomes a bottleneck.
      
      It is profile result when "create index on NUMERIC column" is executed:
      
        %   cumulative   self              self     total
       time   seconds   seconds    calls   s/call   s/call  name
       17.61     10.27    10.27 34542006     0.00     0.00  cmp_numerics
       11.90     17.21     6.94 34542006     0.00     0.00  comparetup_index
        7.42     21.54     4.33 71102587     0.00     0.00  AllocSetAlloc
        7.02     25.64     4.09 69084012     0.00     0.00  set_var_from_num
        4.87     28.48     2.84 69084012     0.00     0.00  alloc_var
        4.79     31.27     2.79 142205745     0.00     0.00  AllocSetFreeIndex
        4.55     33.92     2.65 34542004     0.00     0.00  cmp_abs
        4.07     36.30     2.38 71101189     0.00     0.00  AllocSetFree
        3.83     38.53     2.23 69084012     0.00     0.00  free_var
      
      The create index command executes many comparisons of Numeric values.
      Functions other than comparetup_index spent a lot of cycles for
      conversion from Numeric to NumericVar.
      
      An attached patch enables the comparison of Numeric values without
      executing conversion to NumericVar. The execution time of that SQL
      becomes half.
      
      o Test SQL (index_test table has 1,000,000 tuples)
       create index index_test_idx on index_test(num_col);
      
      o Test results (executed the test five times)
      (1)PentiumIII
       original: 39.789s  36.823s  36.737s  37.752s  37.019s
       patched : 18.560s  19.103s  18.830s  18.408s  18.853s
        4.07     36.30     2.38 71101189     0.00     0.00  AllocSetFree
        3.83     38.53     2.23 69084012     0.00     0.00  free_var
      
      The create index command executes many comparisons of Numeric values.
      Functions other than comparetup_index spent a lot of cycles for
      conversion from Numeric to NumericVar.
      
      An attached patch enables the comparison of Numeric values without
      executing conversion to NumericVar. The execution time of that SQL
      becomes half.
      
      o Test SQL (index_test table has 1,000,000 tuples)
       create index index_test_idx on index_test(num_col);
      
      o Test results (executed the test five times)
      (1)PentiumIII
       original: 39.789s  36.823s  36.737s  37.752s  37.019s
       patched : 18.560s  19.103s  18.830s  18.408s  18.853s
      
      (2)Pentium4
       original: 16.349s  14.997s  12.979s  13.169s  12.955s
       patched :  7.005s   6.594s   6.770s   6.740s   6.828s
      
      (3)Itanium2
       original: 15.392s  15.447s  15.350s  15.370s  15.417s
       patched :  7.413s   7.330s   7.334s   7.339s   7.339s
      
      (4)Ultra Sparc
       original: 64.435s  59.336s  59.332s  58.455s  59.781s
       patched : 28.630s  28.666s  28.983s  28.744s  28.595s
      
      Atsushi Ogawa
      e7a9ccdb
  15. Feb 04, 2006
  16. Feb 03, 2006
  17. Jan 26, 2006
  18. Jan 25, 2006
  19. Jan 23, 2006
  20. Jan 21, 2006
    • Bruce Momjian's avatar
      Add GRANT ON SEQUENCE syntax to support sequence-only permissions. · 4789e988
      Bruce Momjian authored
      Continue to support GRANT ON [TABLE] for sequences for backward
      compatibility;  issue warning for invalid sequence permissions.
      
      [Backward compatibility warning message.]
      
      Add USAGE permission for sequences that allows only currval() and
      nextval(), not setval().
      
      Mention object name in grant/revoke warnings because of possible
      multi-object operations.
      4789e988
  21. Jan 19, 2006
    • Tom Lane's avatar
      Add some test scaffolding to allow cache-flush stress testing (and I do · efbe674e
      Tom Lane authored
      mean stress ... system is orders of magnitude slower with this enabled).
      efbe674e
    • Tom Lane's avatar
      Avoid crashing if relcache flush occurs while trying to load data into an · ed69cf5d
      Tom Lane authored
      index's support-function cache (in index_getprocinfo).  Since none of that
      data can change for an index that's in active use, it seems sufficient to
      treat all open indexes the same way we were treating "nailed" system indexes
      --- that is, just re-read the pg_class row and leave the rest of the relcache
      entry strictly alone.  The pg_class re-read might not be strictly necessary
      either, but since the reltablespace and relfilenode can change in normal
      operation it seems safest to do it.  (We don't support changing any of the
      other info about an index at all, at the moment.)
      
      Back-patch as far as 8.0.  It might be possible to adapt the patch to 7.4,
      but it would take more work than I care to expend for such a low-probability
      problem.  7.3 is out of luck for sure.
      ed69cf5d
    • Tom Lane's avatar
      Fix a tiny memory leak (one List header) in RelationCacheInvalidate(). · b0be247e
      Tom Lane authored
      This is utterly insignificant in normal operation, but it becomes a
      problem during cache inval stress testing.  The original coding in fact
      had no leak --- the 8.0 List rewrite created the issue.  I wonder whether
      list_concat should pfree the discarded header?
      b0be247e
  22. Jan 18, 2006
    • Neil Conway's avatar
      Add a new system view, pg_cursors, that displays the currently available · 33e06ebc
      Neil Conway authored
      cursors. Patch from Joachim Wieland, review and ediorialization by Neil
      Conway. The view lists cursors defined by DECLARE CURSOR, using SPI, or
      via the Bind message of the frontend/backend protocol. This means the
      view does not list the unnamed portal or the portal created to implement
      EXECUTE. Because we do list SPI portals, there might be more rows in
      this view than you might expect if you are using SPI implicitly (e.g.
      via a procedural language).
      
      Per recent discussion on -hackers, the query string included in the
      view for cursors defined by DECLARE CURSOR is based on
      debug_query_string. That means it is not accurate if multiple queries
      separated by semicolons are submitted as one query string. However,
      there doesn't seem a trivial fix for that: debug_query_string
      is better than nothing. I also changed SPI_cursor_open() to include
      the source text for the portal it creates: AFAICS there is no reason
      not to do this.
      
      Update the documentation and regression tests, bump the catversion.
      33e06ebc
Loading