Tom Lane [Fri, 28 Jan 2005 20:34:27 +0000 (20:34 +0000)]
When dealing with multiple grouping columns coming from the same table,
clamp the estimated number of groups to table row count over 10, instead
of table row count; this reflects a heuristic that people probably won't
group over a near-unique set of columns, and the knowledge that we don't
currently have any way to estimate the correlation of the columns better
than guessing. This change creates a trivial plan change in one of the
regression tests.
Tom Lane [Fri, 28 Jan 2005 19:34:28 +0000 (19:34 +0000)]
Improve planner's estimation of the space needed for HashAgg plans:
look at the actual aggregate transition datatypes and the actual overhead
needed by nodeAgg.c, instead of using pessimistic round numbers.
Per a discussion with Michael Tiemann.
Tom Lane [Fri, 28 Jan 2005 00:34:32 +0000 (00:34 +0000)]
Adjust mkdir_p to do stat() before trying mkdir(). Avoids problems on
Solaris and should be a little faster anyway, since in most scenarios
all but perhaps the last path component will already exist.
Neil Conway [Thu, 27 Jan 2005 23:36:15 +0000 (23:36 +0000)]
Small patch to move get_grosysid() from catalog/aclchk.c to
utils/cache/lsyscache.c where it can be used by other things. Also
cleans up both get_usesysid() and get_grosysid() a bit. From Stephen
Frost.
Neil Conway [Thu, 27 Jan 2005 06:36:42 +0000 (06:36 +0000)]
Provide a more descriptive error message when the return type of an SRF
does not match what the query expected. From Brendan Jurd, minor
editorializing by Neil Conway.
Tom Lane [Thu, 27 Jan 2005 03:19:37 +0000 (03:19 +0000)]
Generalize TRUNCATE to support truncating multiple tables in one
command. This is useful because we can allow truncation of tables
referenced by foreign keys, so long as the referencing table is
truncated in the same command.
Tom Lane [Wed, 26 Jan 2005 23:20:21 +0000 (23:20 +0000)]
Close all cursors created during a failed subtransaction. This is needed
to avoid problems when a cursor depends on objects created or changed in
the same subtransaction. We'd like to do better someday, but this seems
the only workable answer for 8.0.1.
Tom Lane [Wed, 26 Jan 2005 21:24:12 +0000 (21:24 +0000)]
Minor tweak to avoid unnecessary memory bloat when dumping extremely wide
column values in -d mode. Per report from Marty Scholes. This doesn't
completely solve the issue, because we still need multiple copies of the
field value, but at least one copy can be got rid of painlessly ...
Neil Conway [Wed, 26 Jan 2005 08:04:04 +0000 (08:04 +0000)]
The attached patch implements the soundex difference function which
compares two strings' soundex values for similarity, from Kris Jurka.
Also mark the text_soundex() function as STRICT, to avoid crashing
on NULL input.
So, changed interface to dictionaries, lexize method of dictionary shoud return
pointer to aray of TSLexeme structs instead of char**. Last element should
have TSLexeme->lexeme == NULL.
typedef struct {
/* number of variant of split word , for example
Word 'fotballklubber' (norwegian) has two varian to split:
( fotball, klubb ) and ( fot, ball, klubb ). So, dictionary
should return:
nvariant lexeme
1 fotball
1 klubb
2 fot
2 ball
2 klubb
Neil Conway [Tue, 25 Jan 2005 03:22:19 +0000 (03:22 +0000)]
Regression tests for recent bugfix to ALTER TABLE ADD COLUMN: ensure that
constraints on domain types are properly enforced, even if the newly
added column has no default value. Per bug #1433.
Tom Lane [Mon, 24 Jan 2005 23:21:57 +0000 (23:21 +0000)]
Fix ALTER TABLE ADD COLUMN so that constraints of domain types are
enforced properly when there is no explicit default value for the new
column. Per report from Craig Perras.
Tom Lane [Sun, 23 Jan 2005 02:21:36 +0000 (02:21 +0000)]
The result of a FULL or RIGHT join can't be assumed to be sorted by the
left input's sorting, because null rows may be inserted at various points.
Per report from Ferenc Lutischá¸n.
Tom Lane [Sun, 23 Jan 2005 00:30:26 +0000 (00:30 +0000)]
pg_dump dumped the wrong tablespace for an index (ie, the parent table's
tablespace instead of the index's own), except when the index was created
as a constraint. Report and fix by Tanida Yutaka.
Tom Lane [Sun, 23 Jan 2005 00:03:54 +0000 (00:03 +0000)]
New routine _getObjectDescription() failed to cope with some aspects of
pre-7.3 pg_dump archive files: namespace isn't there, and in some cases
te->tag may already be quotified. Per report from Alan Pevec and
followup testing.
Bruce Momjian [Sat, 22 Jan 2005 20:05:23 +0000 (20:05 +0000)]
Update count(*) discussion ideas:
< BY col {DESC} LIMIT 1. Completing this item involves making this
> BY col {DESC} LIMIT 1. Completing this item involves doing this
< invalidated if anyone modifies the table.
<
> invalidated if anyone modifies the table. Another idea is to
> get a count directly from a unique index, but for this to be
> faster than a sequential scan it must avoid access to the heap
> to obtain tuple visibility information.
>
> * Allow data to be pulled directly from indexes
>
> Currently indexes do not have enough tuple tuple visibility
> information to allow data to be pulled from the index without
> also accessing the heap. One way to allow this is to set a bit
> to index tuples to indicate if a tuple is currently visible to
> all transactions when the first valid heap lookup happens. This
> bit would have to be cleared when a heap tuple is expired.
>
Neil Conway [Sat, 22 Jan 2005 05:12:33 +0000 (05:12 +0000)]
This patch updates the regression tests to allow "make installcheck" to
pass if "default_with_oids" is set to false. I took the approach of
explicitly adding WITH OIDS to the CREATE TABLEs where necessary, rather
than tweaking the default_with_oids GUC var.
Neil Conway [Tue, 18 Jan 2005 23:25:55 +0000 (23:25 +0000)]
This patch makes some improvements to the rtree index implementation:
(1) Keep a pin on the scan's current buffer and mark buffer. This
avoids the need to do a ReadBuffer() for each tuple produced by the
scan. Since ReadBuffer() is expensive, this is a significant win.
(2) Convert a ReleaseBuffer(); ReadBuffer() pair into
ReleaseAndReadBuffer(). Surely not a huge win, but it saves a lock
acquire/release...
(3) Remove a bunch of duplicated code in rtget.c; make rtnext() handle
both the "initial result" and "subsequent result" cases.
(4) Add support for index tuple killing
(5) Remove rtscancache(): it is dead code, for the same reason that
gistscancache() is dead code (an index scan ought not be invoked with
NoMovementScanDirection).
The end result is about a 10% improvement in rtree index scan perf,
according to contrib/rtree_gist/bench.