Commit Graph

22755 Commits

Author SHA1 Message Date
Tom Lane 485375a1c9 Fix hash aggregation to suppress unneeded columns from being stored in
tuple hash table entries.  This addresses the problem previously noted
that use of a 'physical tlist' in the input scan node could bloat the
hash table entries far beyond what the planner expects.  It's a better
answer than my previous thought of undoing the physical tlist optimization,
because we can also remove columns that are needed to compute the aggregate
functions but aren't part of the grouping column set.
2006-06-28 19:40:52 +00:00
Tom Lane cfc710312e Adjust TupleHashTables to use MinimalTuple format for contained tuples. 2006-06-28 17:05:49 +00:00
Bruce Momjian 15897332ed Update:
< 		o Add support for WITH HOLD cursors
> 		o Add support for WITH HOLD and SCROLL cursors
>
> 		  PL/pgSQL cursors should support the same syntax as
> 		  backend cursors.
>
2006-06-28 15:39:32 +00:00
Bruce Momjian c2c4f3c30e Update Russian FAQ.
Viktor Vislobokov
2006-06-28 13:10:18 +00:00
Teodor Sigaev 783a73168b Forget to add new file :(( 2006-06-28 12:08:35 +00:00
Teodor Sigaev 1f7ef548ec Changes
* new split algorithm (as proposed in http://archives.postgresql.org/pgsql-hackers/2006-06/msg00254.php)
  * possible call pickSplit() for second and below columns
  * add spl_(l|r)datum_exists to GIST_SPLITVEC -
    pickSplit should check its values to use already defined
    spl_(l|r)datum for splitting. pickSplit should set
    spl_(l|r)datum_exists to 'false' (if they was 'true') to
    signal to caller about using spl_(l|r)datum.
  * support for old pickSplit(): not very optimal
    but correct split
* remove 'bytes' field from GISTENTRY: in any case size of
  value is defined by it's type.
* split GIST_SPLITVEC to two structures: one for using in picksplit
  and second - for internal use.
* some code refactoring
* support of subsplit to rtree opclasses

TODO: add support of subsplit to contrib modules
2006-06-28 12:00:14 +00:00
Tom Lane a1dc5c60bc Remove embedded newline in string literal --- seems to make newer gcc
versions very unhappy, and shouldn't be there anyway.
2006-06-27 23:25:28 +00:00
Bruce Momjian 370a709c75 Add GUC update_process_title to control whether 'ps' display is updated
for every command, default to on.
2006-06-27 22:16:44 +00:00
Tom Lane 69d0a15e2a Convert hash join code to use MinimalTuple format in tuple hash table
and batch files.  Should reduce memory and I/O demands for such joins.
2006-06-27 21:31:20 +00:00
Bruce Momjian 665c5e861a Default stats_command_string to 'on', now that its overhead is minimal. 2006-06-27 19:07:50 +00:00
Tom Lane 3c71244b74 Put #ifdef NOT_USED around posix_fadvise call. We may want to resurrect
this someday, but right now it seems that posix_fadvise is immature to
the point of being broken on many platforms ... and we don't have any
benchmark evidence proving it's worth spending time on.
2006-06-27 18:59:17 +00:00
Bruce Momjian 33b4ad66c9 Revert patch, doesn't do what it should:
* %Disallow changing default expression of a SERIAL column

Dhanaraj M
2006-06-27 18:35:05 +00:00
Tom Lane cdd5178c69 Extend the MinimalTuple concept to tuplesort.c, thereby reducing the
per-tuple space overhead for sorts in memory.  I chose to replace the
previous patch that tried to write out the bare minimum amount of data
when sorting on disk; instead, just dump the MinimalTuples as-is.  This
wastes 3 to 10 bytes per tuple depending on architecture and null-bitmap
length, but the simplification in the writetup/readtup routines seems
worth it.
2006-06-27 16:53:02 +00:00
Bruce Momjian e99507eaa1 Will revert in next patch more cleanly.
> * -Disallow changing DEFAULT expression of a SERIAL column
2006-06-27 16:42:00 +00:00
Bruce Momjian 0c99c0fecf Not done:
< * -Disallow changing DEFAULT expression of a SERIAL column
> * %Disallow changing DEFAULT expression of a SERIAL column
2006-06-27 16:39:27 +00:00
Alvaro Herrera 32ad0fc183 Clamp last_anl_tuples to n_live_tuples, in case we vacuum a table without
analyzing, so that future analyze threshold calculations don't get confused.
Also, make sure we correctly track the decrease of live tuples cause by
deletes.

Per report from Dylan Hansen, patches by Tom Lane and me.
2006-06-27 03:45:16 +00:00
Bruce Momjian dc2c25fc62 Add INCLUDING CONSTRAINTS to CREATE TABLE LIKE.
Greg Stark
2006-06-27 03:43:20 +00:00
Bruce Momjian 62f2693688 Done:
< * %Disallow changing DEFAULT expression of a SERIAL column?
<
<   This should be done only if the existing SERIAL problems cannot be
<   fixed.
<
> * -Disallow changing DEFAULT expression of a SERIAL column
2006-06-27 03:22:45 +00:00
Bruce Momjian 424b8e64c7 Disallow changing/dropping default expression of a SERIAL column
Dhanaraj M
2006-06-27 03:21:55 +00:00
Bruce Momjian ba4b9c0d8c Fix for recent Win32 pg_dump tar temp file patch.
Hiroshi Saito
2006-06-27 02:56:41 +00:00
Tom Lane 3f50ba27cf Create infrastructure for 'MinimalTuple' representation of in-memory
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.
2006-06-27 02:51:40 +00:00
Bruce Momjian fe491fb9af On Win32, use loop to create pg_dump temporary tar file in the current
directory, not in device root, for permission reasons.

Backpatch to 8.1.X.
2006-06-27 01:16:58 +00:00
Bruce Momjian 560feb474a Done:
> 	o -Add PQescapeIdentifier()
2006-06-27 00:03:44 +00:00
Bruce Momjian 3b1790f987 Add PQescapeIdentifier() to libpq
Christopher Kings-Lynne
2006-06-27 00:03:42 +00:00
Bruce Momjian 59a853e48b Fix blank line. 2006-06-26 23:53:14 +00:00
Bruce Momjian ecae3a9689 Add comment about the use of pg_config_paths.h. 2006-06-26 18:40:50 +00:00
Tom Lane ca0d2197ca Change the row constructor syntax (ROW(...)) so that list elements foo.*
will be expanded to a list of their member fields, rather than creating
a nested rowtype field as formerly.  (The old behavior is still available
by omitting '.*'.)  This syntax is not allowed by the SQL spec AFAICS,
so changing its behavior doesn't violate the spec.  The new behavior is
substantially more useful since it allows, for example, triggers to check
for data changes with 'if row(new.*) is distinct from row(old.*)'.  Per
my recent proposal.
2006-06-26 17:24:41 +00:00
Michael Meskes 4b98d423d7 Added missing braces to prevent a segfault after usage of an undeclared cursor. 2006-06-26 14:12:02 +00:00
Bruce Momjian 6bf44d51ea Use Unix newlines, instead of DOS ones. 2006-06-26 13:04:05 +00:00
Bruce Momjian e56756e94e Use Unix line endings instead of DOS ones, per Magnus. 2006-06-26 12:59:44 +00:00
Bruce Momjian e2fee8cf6d Update include files to Unix newline format, per report from Magnus. 2006-06-26 12:52:12 +00:00
Bruce Momjian 217d543943 Update comment description of geo routines and move comment to more
relevant location.
2006-06-26 12:32:42 +00:00
Michael Meskes ea9ec780ed Added some more coverity report patches send in by Joachim Wieland <joe@mcknight.de>. 2006-06-26 09:20:09 +00:00
Bruce Momjian bc28f58b8f Update my info:
> * Bruce is Bruce Momjian <bruce@momjian.us> of EnterpriseDB
2006-06-25 18:52:03 +00:00
Tom Lane 2924ca6747 Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.
palloc() will normally round allocation requests up to the next power of 2,
so make dynahash choose allocation sizes that are as close to a power of 2
as possible.
Back-patch to 8.1 --- the problem exists further back, but a much larger
patch would be needed and it doesn't seem worth taking any risks.
2006-06-25 18:29:49 +00:00
Bruce Momjian f5940e7b34 Add:
< * Reuse index tuples that point to rows that are not visible to anyone?
> * Reuse index tuples that point to heap tuples that are not visible to
>   anyone?
2006-06-25 16:27:41 +00:00
Michael Meskes 17bab8c3fe Moved some free() calls that coverity correctly complains about. 2006-06-25 09:38:40 +00:00
Alvaro Herrera 885a4d3d9a Our version of getopt_long does not set optarg upon detecting an error, as
opposed to what other versions apparently do, so it's not safe to print an
error message.  Besides, getopt_long itself already did, so it's redundant
anyway.
2006-06-25 04:37:55 +00:00
Bruce Momjian e970b2a62b Remove individual user copyright because the code is contributed to
PGDG:

> Yes. In fact the copyright belongs to credativ GmbH the company that
> paid Carsten for his work. As you may or may not know I'm the CEO of
> that company and can assure you that his work was contributed to the
> PostgreSQL project.
2006-06-25 01:45:32 +00:00
Bruce Momjian 199f8f2858 Fix GEVHDRSZ for Win32.
Magnus Hagander
2006-06-25 01:02:12 +00:00
Bruce Momjian d8f75d4131 Fix Win32/Cygwin problems:
After updating to the latest cvs, and also building most of the addons
(like PLs), the following patch is neededf for win32 + Visual C++.

* Switch to use the new win32 semaphore code
* Rename win32_open to pgwin32_open. win32_open collides with symbols
defined in Perl. MingW didn't detect ig, MSVC did. And it's a bit too
generic a name to export globally, imho...
* Python defines some partially broken #pragmas in the headers when
doing a debug build. Workaround.

Magnus Hagander
2006-06-25 00:18:24 +00:00
Bruce Momjian ac7a126d0c Update entry:
< * Allow heap reuse of UPDATEd rows if old and new versions are on the
<   same heap page?
> * Allow heap reuse of UPDATEd rows if no indexed columns are changed,
>   and old and new versions are on the same heap page?
<   This is possible for same-page updates because a single index row
<   can point to both old and new values.
>   While vacuum handles DELETEs fine, updating of non-indexed columns, like
>   counters, are difficult for VACUUM to handle efficiently.  This method
>   is possible for same-page updates because a single index row can be
>   used to point to both old and new values.
2006-06-24 23:47:58 +00:00
Bruce Momjian fc6a2293b5 Add UPDATE entry for row reuse.
>
> * Allow heap reuse of UPDATEd rows if old and new versions are on the
>   same heap page?
>
>   This is possible for same-page updates because a single index row
>   can point to both old and new values.
>   http://archives.postgresql.org/pgsql-hackers/2006-06/msg01305.php
2006-06-24 23:45:02 +00:00
Tom Lane 50aa69a825 Fix re-inclusion of port header file on Windows, per Magnus. 2006-06-24 14:52:48 +00:00
Michael Meskes c2f3c168fb Clarified copyright notice 2006-06-23 14:50:01 +00:00
Tom Lane 69bf0a0ddd Remove dllinit.c; it was only needed for long-obsolete Cygwin versions,
and there was some question about its copyright status.
2006-06-22 23:50:35 +00:00
Tom Lane 3a04f53e7f pg_stop_backup was calling XLogArchiveNotify() twice for the newly created
backup history file.  Bug introduced by the 8.1 change to make pg_stop_backup
delete older history files.  Per report from Masao Fujii.
2006-06-22 20:42:57 +00:00
Tom Lane 39bed3b388 Standalone backends need pgstat_bestart() too, per Qingqing Zhou. 2006-06-22 14:36:12 +00:00
Tom Lane a5606579fc Move setup_cancel_handler() up near start of psql main(), where the
setup_win32_locks() call formerly was, to ensure that cancelConnLock is
valid when it needs to be.  Per Yoshiyuki Asaba.
2006-06-21 19:40:31 +00:00
Tom Lane 59fd249a30 Remove ancient kluge that kept nodeAgg.c from crashing on UPDATEs involving
aggregates.  We just disallowed that, and AFAICS there should be no other
cases where direct (non-aggregated) references to input columns are allowed
in a query with aggregation and no GROUP BY.
2006-06-21 18:39:42 +00:00