Commit Graph

20003 Commits

Author SHA1 Message Date
Tom Lane 9d64632144 Minor performance improvement: avoid unnecessary creation/unioning of
bitmaps for multiple indexscans.  Instead just let each indexscan add
TIDs directly into the BitmapOr node's result bitmap.
2005-04-20 15:48:36 +00:00
Bruce Momjian de4fbfadc5 Add:
> * Add tool to query pg_stat_* tables and report indexes that aren't needed
>   or tables that might need indexes
2005-04-20 02:48:11 +00:00
Bruce Momjian e5c7c05168 Add:
> * Log queries where the optimizer row estimates were dramatically
>   different from the number of rows actually found (?)
2005-04-20 02:43:49 +00:00
Bruce Momjian 047b8a71d1 Add:
> * All ability to monitor the use of temporary sort files
2005-04-20 01:17:34 +00:00
Tom Lane 4a8c5d0375 Create executor and planner-backend support for decoupled heap and index
scans, using in-memory tuple ID bitmaps as the intermediary.  The planner
frontend (path creation and cost estimation) is not there yet, so none
of this code can be executed.  I have tested it using some hacked planner
code that is far too ugly to see the light of day, however.  Committing
now so that the bulk of the infrastructure changes go in before the tree
drifts under me.
2005-04-19 22:35:18 +00:00
Teodor Sigaev 04ce41ca62 Add comment about permissions on pg_ts* tables 2005-04-19 13:58:48 +00:00
Bruce Momjian fa66de98a9 >>>>Luckily, PG 8 is available for this. Do you have a short example?
>>>
>>>No, and I think it should be in the manual as an example.
>>>
>>>You will need to enter a loop that uses exception handling to detect
>>>unique_violation.
>>
>>Pursuant to an IRC discussion to which Dennis Bjorklund and
>>Christopher Kings-Lynne made most of the contributions, please find
>>enclosed an example patch demonstrating an UPSERT-like capability.
>>

David Fetter
2005-04-19 03:55:43 +00:00
Bruce Momjian bd32a25598 > >Luckily, PG 8 is available for this. Do you have a short example?
>
> No, and I think it should be in the manual as an example.
>
> You will need to enter a loop that uses exception handling to detect
> unique_violation.

Pursuant to an IRC discussion to which Dennis Bjorklund and
Christopher Kings-Lynne made most of the contributions, please find
enclosed an example patch demonstrating an UPSERT-like capability.

David Fetter
2005-04-19 03:37:20 +00:00
Bruce Momjian 7cce39c7ce The following patch should allow UPDATE_INTERVAL to be specified on the
command line. We find this useful because we frequently deal with
thousands of tables in an environment where neither the databases nor
the tables are updated frequently. This helps allow us to cut down on
the overhead of updating the list for every other primary loop of
pg_autovacuum.

I chose -i as the command-line argument and documented it briefly in
the README.

The patch was applied to the 7.4.7 version of pg_autovacuum in contrib.

Thomas F.O'Connell
2005-04-19 03:35:15 +00:00
Bruce Momjian aa8bdab272 Attached patch gets rid of the global timezone in the following steps:
* Changes the APIs to the timezone functions to take a pg_tz pointer as
an argument, representing the timezone to use for the selected
operation.

* Adds a global_timezone variable that represents the current timezone
in the backend as set by SET TIMEZONE (or guc, or env, etc).

* Implements a hash-table cache of loaded tables, so we don't have to
read and parse the TZ file everytime we change a timezone. While not
necesasry now (we don't change timezones very often), I beleive this
will be necessary (or at least good) when "multiple timezones in the
same query" is eventually implemented. And code-wise, this was the time
to do it.


There are no user-visible changes at this time. Implementing the
"multiple zones in one query" is a later step...

This also gets rid of some of the cruft needed to "back out a timezone
change", since we previously couldn't check a timezone unless it was
activated first.

Passes regression tests on win32, linux (slackware 10) and solaris x86.

Magnus Hagander
2005-04-19 03:13:59 +00:00
Bruce Momjian dd39dd232f Update PITR wording, per Simon. 2005-04-19 01:39:50 +00:00
Tom Lane c822fe05ae pg_dumpall should enforce the server version check for itself, rather
than simply passing it down to pg_dump.  Else, version-related failures
in pg_dumpall itself generate unhelpful error messages.
2005-04-18 23:47:52 +00:00
Bruce Momjian 8023b7fa5a Add WAL entry about compression. 2005-04-18 18:30:56 +00:00
Bruce Momjian 07dfdb8dd0 Added to TODO:
> * Compress WAL entries [wal]
2005-04-18 18:29:57 +00:00
Bruce Momjian 01979d1bd5 Update PITR setence to mention WAL and file system dump. 2005-04-18 17:40:40 +00:00
Tom Lane 7aa066f11d record_in and record_recv must be careful to return a separately
pfree'able result, since some callers expect to be able to pfree
the result of a pass-by-reference function.  Per report from Chris Trawick.
2005-04-18 17:11:05 +00:00
Bruce Momjian d304067695 Update PITR TODO items:
<   failure.
>   failure.  This could be triggered by a user command or a timer.
< * Force archiving of partially-full WAL files when pg_stop_backup() is
<   called or the server is stopped
> * Automatically force archiving of partially-filled WAL files when
>   pg_stop_backup() is called or the server is stopped
2005-04-18 15:03:21 +00:00
Bruce Momjian 54fe332776 Update TODO script sample. 2005-04-18 14:44:04 +00:00
Bruce Momjian 03d712d9f4 Update for HTML markup. 2005-04-18 14:42:35 +00:00
Bruce Momjian 68d2f9283d Add description that WAL files used during backup have to be archived
before you are done.
2005-04-18 13:11:04 +00:00
Bruce Momjian c68f6d7963 Add HTML version of TODO to CVS, for web site use. 2005-04-18 12:58:45 +00:00
Bruce Momjian 11ab2b85d7 Add HTML TODO version to CVS. 2005-04-18 12:58:11 +00:00
Bruce Momjian 584693cc6d Add description about partial WAL archiving for PITR:
>
>   Doing this will allow administrators to know more easily when the
>   archive contins all the files needed for point-in-time recovery.
2005-04-18 12:51:41 +00:00
Bruce Momjian 41d64a185e Fix html. 2005-04-18 03:46:31 +00:00
Bruce Momjian f1e8b57731 Test new html tag. 2005-04-18 03:17:23 +00:00
Bruce Momjian c57a418ce6 Add:
> * Force archiving of partially-full WAL files when pg_stop_backup() is
>   called or the server is stopped
2005-04-18 03:00:44 +00:00
Bruce Momjian d755688f24 Update PITR mention of which WAL files are needed. 2005-04-18 01:29:00 +00:00
Tom Lane db30652135 Initial implementation of lossy-tuple-bitmap data structures.
Not connected to anything useful yet ...
2005-04-17 22:24:02 +00:00
Bruce Momjian 18b985055d Clarify name of file to be checked for PITR expiring. 2005-04-17 03:05:19 +00:00
Bruce Momjian 1a6ad669fb Fix comment typo. 2005-04-17 03:04:29 +00:00
Tom Lane d8b1bf4791 Create a new 'MultiExecProcNode' call API for plan nodes that don't
return just a single tuple at a time.  Currently the only such node
type is Hash, but I expect we will soon have indexscans that can return
tuple bitmaps.  A side benefit is that EXPLAIN ANALYZE now shows the
correct tuple count for a Hash node.
2005-04-16 20:07:35 +00:00
Tom Lane 85eee28cec Minor improvements to locale documentation. 2005-04-16 16:50:01 +00:00
Tom Lane 5f0a974ea9 Reduce PANIC to ERROR in several xlog routines that are used in both
critical and noncritical contexts (an example of noncritical being
post-checkpoint removal of dead xlog segments).  In the critical cases
the CRIT_SECTION mechanism will cause ERROR to be promoted to PANIC
anyway, and in the noncritical cases we shouldn't let an error take
down the entire database.  Arguably there should be *no* explicit
PANIC errors in this module, only more START/END_CRIT_SECTION calls,
but I didn't go that far.  (Yet.)
2005-04-15 22:19:48 +00:00
Tom Lane 61b861421b Modify MoveOfflineLogs/InstallXLogFileSegment to avoid O(N^2) behavior
when recycling a large number of xlog segments during checkpoint.
The former behavior searched from the same start point each time,
requiring O(checkpoint_segments^2) stat() calls to relocate all the
segments.  Instead keep track of where we stopped last time through.
2005-04-15 18:48:10 +00:00
Tom Lane 348f856dc5 Revert addition of poorly-thought-out DUMP TIMESTAMP archive entry,
which induced bug #1597 in addition to having several other misbehaviors
(like labeling the dump with a completion time having nothing to do with
reality).  Instead just print out the desired strings where RestoreArchive
was already emitting the 'PostgreSQL database dump' and
'PostgreSQL database dump complete' strings.
2005-04-15 16:40:36 +00:00
Neil Conway 3fa7901070 This patch changes the use of varargs.h to stdarg.h as
required by modern versions of GCC.

Niels Breet
2005-04-15 04:29:32 +00:00
Neil Conway ea208aca00 Remove an unused variable "waitingForSignal". From Qingqing Zhou. 2005-04-15 04:18:10 +00:00
Bruce Momjian ad9201f982 Done
> * -Use indexes for MIN() and MAX()
2005-04-14 23:20:55 +00:00
Tom Lane 8e14408028 Make equalTupleDescs() compare attlen/attbyval/attalign rather than
assuming comparison of atttypid is sufficient.  In a dropped column
atttypid will be 0, and we'd better check the physical-storage data
to make sure the tupdescs are physically compatible.
I do not believe there is a real risk before 8.0, since before that
we only used this routine to compare successive states of the tupdesc
for a particular relation.  But 8.0's typcache.c might be comparing
arbitrary tupdescs so we'd better play it safer.
2005-04-14 22:34:48 +00:00
Tom Lane 0453a997af Put back blessing of record-function tupledesc, which I removed in a
fit of over-optimization.
2005-04-14 22:09:40 +00:00
Tom Lane 939712ee73 Don't try to constant-fold functions returning RECORD, since the optimizer
isn't presently set up to pass them an expected tuple descriptor.  Bug has
been there since 7.3 but was just recently reported by Thomas Hallgren.
2005-04-14 21:44:09 +00:00
Tom Lane b79a718fac Must count '*' characters as potential arguments. 2005-04-14 20:53:09 +00:00
Tom Lane 055467d504 Marginal hack to use a specialized hash function for dynahash hashtables
whose keys are OIDs.  The only one that looks particularly performance
critical is the relcache hashtable, but as long as we've got the function
we may as well use it wherever it's applicable.
2005-04-14 20:32:43 +00:00
Tom Lane 162bd08b3f Completion of project to use fixed OIDs for all system catalogs and
indexes.  Replace all heap_openr and index_openr calls by heap_open
and index_open.  Remove runtime lookups of catalog OID numbers in
various places.  Remove relcache's support for looking up system
catalogs by name.  Bulky but mostly very boring patch ...
2005-04-14 20:03:27 +00:00
Michael Meskes 9dc2e6deaf Added patch by Philip Yarra <philip.yarra@internode.on.net> for a bug in thread support. 2005-04-14 10:08:57 +00:00
Tom Lane 7c13781ee7 First phase of project to use fixed OIDs for all system catalogs and
indexes.  Extend the macros in include/catalog/*.h to carry the info
about hand-assigned OIDs, and adjust the genbki script and bootstrap
code to make the relations actually get those OIDs.  Remove the small
number of RelOid_pg_foo macros that we had in favor of a complete
set named like the catname.h and indexing.h macros.  Next phase will
get rid of internal use of names for looking up catalogs and indexes;
but this completes the changes forcing an initdb, so it looks like a
good place to commit.
Along the way, I made the shared relations (pg_database etc) not be
'bootstrap' relations any more, so as to reduce the number of hardwired
entries and simplify changing those relations in future.  I'm not
sure whether they ever really needed to be handled as bootstrap
relations, but it seems to work fine to not do so now.
2005-04-14 01:38:22 +00:00
Tom Lane 2193a856a2 Simplify initdb-time assignment of OIDs as I proposed yesterday, and
avoid encroaching on the 'user' range of OIDs by allowing automatic
OID assignment to use values below 16k until we reach normal operation.

initdb not forced since this doesn't make any incompatible change;
however a lot of stuff will have different OIDs after your next initdb.
2005-04-13 18:54:57 +00:00
Tom Lane 2fdf9e0be6 Change addRangeTableEntryForRelation() to take a Relation pointer instead
of just a relation OID, thereby not having to open the relation for itself.
This actually saves code rather than adding it for most of the existing
callers, which had the rel open already.  The main point though is to be
able to use this rather than plain addRangeTableEntry in setTargetTable,
thus saving one relation_openrv/relation_close cycle for every INSERT,
UPDATE, or DELETE.  Seems to provide a several percent win on simple
INSERTs.
2005-04-13 16:50:55 +00:00
Tom Lane 45c79a3094 Revert yesterday's change to make pg_cast.h say 'OID = 0' in DATA entries.
On reflection, we ought to get rid of that mechanism entirely.
2005-04-13 16:15:35 +00:00
Neil Conway 6853a37a83 Minor consistency improvement to the documentation on array functions. 2005-04-13 00:20:10 +00:00