Commit Graph

26460 Commits

Author SHA1 Message Date
Tom Lane 611b4393f2 Make TransactionIdIsInProgress check transam.c's single-item XID status cache
before it goes groveling through the ProcArray.  In situations where the same
recently-committed transaction ID is checked repeatedly by tqual.c, this saves
a lot of shared-memory searches.  And it's cheap enough that it shouldn't
hurt noticeably when it doesn't help.
Concept and patch by Simon, some minor tweaking and comment-cleanup by Tom.
2008-03-11 20:20:35 +00:00
Bruce Momjian ba8a9a9282 Add:
> 	o Consider normalizing fractions in postgresql.conf, perhaps
> 	  using '%'
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-06/msg00550.php
2008-03-11 20:16:40 +00:00
Bruce Momjian beaef327eb Add:
> * Consider sorting writes during checkpoint
>
>   http://archives.postgresql.org/pgsql-hackers/2007-06/msg00541.php
2008-03-11 20:04:56 +00:00
Bruce Momjian a0e4f5f30a Add:
>
> * Prefix command-line utilities like createuser with 'pg_'
>
>   http://archives.postgresql.org/pgsql-hackers/2007-06/msg00025.php
2008-03-11 19:48:17 +00:00
Bruce Momjian efdb082878 Add:
>
> * Change memory allocation for multi-byte functions so memory is
>   allocated inside conversion functions
>
>   Currently we preallocate memory based on worst-case usage.
2008-03-11 19:44:39 +00:00
Bruce Momjian 177eae145f Add another URL for:
* Consider increasing the number of default statistics target, and
  reduce statistics target overhead

  Also consider having a larger statistics target for indexed columns
  and expression indexes
<
>   http://archives.postgresql.org/pgsql-general/2007-06/msg00542.php
2008-03-11 19:34:12 +00:00
Bruce Momjian 73df8b174e Add URL for:
* Consider increasing the number of default statistics target, and
  reduce statistics target overhead

  Also consider having a larger statistics target for indexed columns
  and expression indexes
>   http://archives.postgresql.org/pgsql-general/2007-05/msg01228.php
>
2008-03-11 19:32:03 +00:00
Bruce Momjian d14ca04e58 Add:
>
> * Consider increasing the number of default statistics target, and
>   reduce statistics target overhead
>
>   Also consider having a larger statistics target for indexed columns
>   and expression indexes
2008-03-11 18:30:50 +00:00
Bruce Momjian 3879b62173 Add:
>
> * Consider using a hash for joining to a large IN (VALUES ...) list
>
>   http://archives.postgresql.org/pgsql-hackers/2007-05/msg00450.php
2008-03-11 18:14:57 +00:00
Bruce Momjian a2c4705702 Add for VACUUM:
>
> * Consider a more compact data representation for dead tuples
>
>   http://archives.postgresql.org/pgsql-patches/2007-05/msg00143.php
2008-03-11 18:05:10 +00:00
Bruce Momjian 8129a814d0 Add URL for:
* Fix problem when multiple subtransactions of the same outer transaction
  hold different types of locks, and one subtransaction aborts

>   http://archives.postgresql.org/pgsql-hackers/2007-05/msg00773.php
2008-03-11 18:01:04 +00:00
Bruce Momjian c3f6ca1e27 Add:
>
> * Add temporal versions of generate_series()
>
>   http://archives.postgresql.org/pgsql-hackers/2007-04/msg01180.php
2008-03-11 17:42:13 +00:00
Bruce Momjian adc0ee5ea1 Add for pl/pgsql:
o Review handling of MOVE and FETCH


http://archives.postgresql.org/pgsql-patches/2007-04/msg00527.php
2008-03-11 17:20:47 +00:00
Bruce Momjian 8e4b2e354f Add:
> 	o Prevent pg_dump/pg_restore from being affected by
> 	  statement_timeout
>
> 	  Using psql to restore a pg_dump dump is also affected.
2008-03-11 17:02:33 +00:00
Bruce Momjian a534afc854 Add to documentation:
+         Setting <varname>statement_timeout</> in
+         <filename>postgresql.conf</> is not recommended because it
+         affects all sessions.

Backpatch to 8.3.X.
2008-03-11 16:59:00 +00:00
Bruce Momjian b633f2b98a Add:
> * Allow statistics last vacuum/analyze execution times to be displayed
>   without requiring stats_row_level to be enabled
2008-03-11 15:52:02 +00:00
Bruce Momjian 2d049a07c9 Back out doc addition that statement_timeout affects autovacuum. 2008-03-11 15:49:46 +00:00
Bruce Momjian 032f9d9a2e Remove item, per Alvaro:
<
< 	o Set up autovacuum to ignore statement_timeout set in
< 	  postgresql.conf
<
< 	  http://archives.postgresql.org/pgsql-hackers/2007-03/msg01753.php
2008-03-11 15:48:50 +00:00
Bruce Momjian bc0fc3ec5f Add:
>
> * Consider adding buffers the BGW finds reusable to the free list
>
>   http://archives.postgresql.org/pgsql-hackers/2007-04/msg00781.php
>
> * Automatically tune bgwriter_delay based on activity rather then using a
>   fixed interval
>
>   http://archives.postgresql.org/pgsql-hackers/2007-04/msg00781.php
2008-03-11 15:45:05 +00:00
Bruce Momjian bbd2e68cfb Document that statement_timeout is not recommended in postgresql.conf
because it affects all sessions, including autovacuum.
2008-03-11 15:39:23 +00:00
Bruce Momjian eb34ffc15b Add:
>
> 	o Set up autovacuum to ignore statement_timeout set in
> 	  postgresql.conf
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-03/msg01753.php
2008-03-11 15:38:54 +00:00
Bruce Momjian bc963fe849 Add URL for:
* Optimize referential integrity checks

>   http://archives.postgresql.org/pgsql-hackers/2007-04/msg00744.php
2008-03-11 14:56:52 +00:00
Bruce Momjian af7545edb7 Add URL for:
* Allow administrators to safely terminate individual sessions either
  via an SQL function or SIGTERM

>   http://archives.postgresql.org/pgsql-hackers/2007-04/msg00218.php
2008-03-11 14:25:51 +00:00
Tom Lane fe83a3fdbd Use -fwrapv in CFLAGS if we are using a version of gcc that accepts this flag.
This prevents compiler optimizations that assume overflow won't occur, which
breaks numerous overflow tests that we need to have working.  It is known
that gcc 4.3 causes problems and possible that 4.1 does.  Per my proposal
of some time ago and a recent report from Kris Jurka.

Backpatch as far as 8.0, which is as far as the patch conveniently goes.
7.x was pretty short of overflow tests anyway, so it may not matter there,
even assuming that anyone cares whether 7.x builds on recent gcc.
2008-03-10 21:50:16 +00:00
Tom Lane f0828b2fc3 Provide a build-time option to store large relations as single files, rather
than dividing them into 1GB segments as has been our longtime practice.  This
requires working support for large files in the operating system; at least for
the time being, it won't be the default.

Zdenek Kotala
2008-03-10 20:06:27 +00:00
Bruce Momjian b6912af22b Add:
>
> * Consider increasing the minimum allowed number of shared buffers
>
>   http://archives.postgresql.org/pgsql-bugs/2008-02/msg00157.php
>
2008-03-10 14:16:37 +00:00
Magnus Hagander 0a66303781 Bump catversion from guc enum patch, which I forgot. Sorry! 2008-03-10 13:53:35 +00:00
Tom Lane 9d966c2e32 Fix unportable coding of new error message, per Kris Jurka. 2008-03-10 12:57:05 +00:00
Magnus Hagander 52a8d4f8f7 Implement enum type for guc parameters, and convert a couple of existing
variables to it. More need to be converted, but I wanted to get this in
before it conflicts with too much...

Other than just centralising the text-to-int conversion for parameters,
this allows the pg_settings view to contain a list of available options
and allows an error hint to show what values are allowed.
2008-03-10 12:55:13 +00:00
Tom Lane 23c356ccec Document and enforce that the usable range of setseed() arguments is
-1 to 1, not 0 to 1.  The actual behavior for values within this range
does not change.  Kris Jurka
2008-03-10 12:39:23 +00:00
Tom Lane bfce56eea4 Throw an error for negative LIMIT or OFFSET values, instead of silently
treating them as zero.  Simon Riggs
2008-03-10 03:37:59 +00:00
Tom Lane 2abf130a4e Increase the default value of log_min_messages to WARNING, so that
NOTICE-grade messages are not logged by default.  Per pgsql-hackers
discussion back on 21-Nov-2007.
2008-03-10 03:22:29 +00:00
Tom Lane 7953fdcd9e Add a CaseSensitive parameter to synonym dictionaries.
Simon Riggs
2008-03-10 03:01:28 +00:00
Tom Lane 2fc2795456 Remove no-longer-used XLogCacheByte field of XLogCtl.
Itagaki Takahiro
2008-03-10 02:13:22 +00:00
Tom Lane 3fcc7e8e18 Reduce memory consumption during VACUUM of large relations, by using
FSMPageData (6 bytes) instead of PageFreeSpaceInfo (8 or 16 bytes)
for the temporary array of page-free-space information.

Itagaki Takahiro
2008-03-10 02:04:10 +00:00
Tom Lane 9537739f7f Fix pgbench's getrand() function so that min and max have approximately
the same chance of being selected as do numbers between them.  Problem
noted by Greg Stark; fix by Alexey Klyukin.
2008-03-10 01:23:04 +00:00
Tom Lane d9384a4b73 Remove postmaster.c's check that NBuffers is at least twice MaxBackends.
With the addition of multiple autovacuum workers, our choices were to delete
the check, document the interaction with autovacuum_max_workers, or complicate
the check to try to hide that interaction.  Since this restriction has never
been adequate to ensure backends can't run out of pinnable buffers, it doesn't
really have enough excuse to live to justify the second or third choices.
Per discussion of a complaint from Andreas Kling (see also bug #3888).

This commit also removes several documentation references to this restriction,
but I'm not sure I got them all.
2008-03-09 04:56:28 +00:00
Tom Lane f4230d2937 Change patternsel() so that instead of switching from a pure
pattern-examination heuristic method to purely histogram-driven selectivity at
histogram size 100, we compute both estimates and use a weighted average.
The weight put on the heuristic estimate decreases linearly with histogram
size, dropping to zero for 100 or more histogram entries.
Likewise in ltreeparentsel().  After a patch by Greg Stark, though I
reorganized the logic a bit to give the caller of histogram_selectivity()
more control.
2008-03-09 00:32:09 +00:00
Tom Lane 422495d0da Modify prefix_selectivity() so that it will never estimate the selectivity
of the generated range condition var >= 'foo' AND var < 'fop' as being less
than what eqsel() would estimate for var = 'foo'.  This is intuitively
reasonable and it gets rid of the need for some entirely ad-hoc coding we
formerly used to reject bogus estimates.  The basic problem here is that
if the prefix is more than a few characters long, the two boundary values
are too close together to be distinguishable by comparison to the column
histogram, resulting in a selectivity estimate of zero, which is often
not very sane.  Change motivated by an example from Peter Eisentraut.

Arguably this is a bug fix, but I'll refrain from back-patching it
for the moment.
2008-03-08 22:41:38 +00:00
Tom Lane 6f10eb2111 Refactor heap_page_prune so that instead of changing item states on-the-fly,
it accumulates the set of changes to be made and then applies them.  It had
to accumulate the set of changes anyway to prepare a WAL record for the
pruning action, so this isn't an enormous change; the only new complexity is
to not doubly mark tuples that are visited twice in the scan.  The main
advantage is that we can substantially reduce the scope of the critical
section in which the changes are applied, thus avoiding PANIC in foreseeable
cases like running out of memory in inval.c.  A nice secondary advantage is
that it is now far clearer that WAL replay will actually do the same thing
that the original pruning did.

This commit doesn't do anything about the open problem that
CacheInvalidateHeapTuple doesn't have the right semantics for a CTID change
caused by collapsing out a redirect pointer.  But whatever we do about that,
it'll be a good idea to not do it inside a critical section.
2008-03-08 21:57:59 +00:00
Bruce Momjian cc05d051a6 Add:
>
> * Consider a function-based API for '@@' full text searches
>
>   http://archives.postgresql.org/pgsql-hackers/2007-11/msg00511.php
>
2008-03-08 17:57:21 +00:00
Andrew Dunstan 95c238d941 Improve efficiency of attribute scanning in CopyReadAttributesCSV.
The loop is split into two parts, inside quotes, and outside quotes, saving some instructions in both parts.

Heikki Linnakangas
2008-03-08 01:16:26 +00:00
Tom Lane 9c767ad57b Improve pglz_decompress() so that it cannot clobber memory beyond the
available output buffer when presented with corrupt input.  Some testing
suggests that this slows the decompression loop about 1%, which seems an
acceptable price to pay for more robustness.  (Curiously, the penalty
seems to be *less* on not-very-compressible data, which I didn't expect
since the overhead per output byte ought to be more in the literal-bytes
path.)

Patch from Zdenek Kotala.  I fixed a corner case and did some renaming
of variables to make the routine more readable.
2008-03-08 01:09:36 +00:00
Tom Lane ad434473eb This patch addresses some issues in TOAST compression strategy that
were discussed last year, but we felt it was too late in the 8.3 cycle to
change the code immediately.  Specifically, the patch:

* Reduces the minimum datum size to be considered for compression from
256 to 32 bytes, as suggested by Greg Stark.

* Increases the required compression rate for compressed storage from
20% to 25%, again per Greg's suggestion.

* Replaces force_input_size (size above which compression is forced)
with a maximum size to be considered for compression.  It was agreed
that allowing large inputs to escape the minimum-compression-rate
requirement was not bright, and that indeed we'd rather have a knob
that acted in the other direction.  I set this value to 1MB for the
moment, but it could use some performance studies to tune it.

* Adds an early-failure path to the compressor as suggested by Jan:
if it's been unable to find even one compressible substring in the
first 1KB (parameterizable), assume we're looking at incompressible
input and give up.  (Possibly this logic can be improved, but I'll
commit it as-is for now.)

* Improves the toasting heuristics so that when we have very large
fields with attstorage 'x' or 'e', we will push those out to toast
storage before considering inline compression of shorter fields.
This also responds to a suggestion of Greg's, though my original
proposal for a solution was a bit off base because it didn't fix
the problem for large 'e' fields.

There was some discussion in the earlier threads of exposing some
of the compression knobs to users, perhaps even on a per-column
basis.  I have not done anything about that here.  It seems to me
that if we are changing around the parameters, we'd better get some
experience and be sure we are happy with the design before we set
things in stone by providing user-visible knobs.
2008-03-07 23:20:21 +00:00
Bruce Momjian 1cc52905f0 Add:
>
> * Add a function like pg_get_indexdef() that report more detailed index
>   information
>
>   http://archives.postgresql.org/pgsql-bugs/2007-12/msg00166.php
>
2008-03-07 20:38:59 +00:00
Bruce Momjian f76eee0bf1 Add:
>
>
> 	o Prevent autovacuum from running if an old transaction is still
> 	  running from the last vacuum
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-11/msg00899.php
>
2008-03-07 20:22:25 +00:00
Bruce Momjian 0323f706b0 Added to TODO:
>
> * Allow text search dictionary to filter out only stop words
>
>   http://archives.postgresql.org/pgsql-patches/2007-11/msg00081.php
2008-03-07 20:06:03 +00:00
Bruce Momjian 090012131c Add to TODO:
>
> * Consider allowing higher priority queries to have referenced buffer
>   cache pages stay in memory longer
>
>   http://archives.postgresql.org/pgsql-hackers/2007-11/msg00562.php
2008-03-07 20:01:24 +00:00
Bruce Momjian 3310b3c144 Add:
>
> * Improve referential integrity checks
>
>   http://archives.postgresql.org/pgsql-performance/2005-10/msg00458.php
2008-03-07 19:18:59 +00:00
Bruce Momjian 4864986e94 Add item:
> 	o Store per-table autovacuum settings in pg_class.reloptions.
>
> 	  http://archives.postgresql.org/pgsql-hackers/2007-02/msg01440.php
> 	  http://archives.postgresql.org/pgsql-hackers/2008-01/msg00724.php
2008-03-07 19:03:39 +00:00