summaryrefslogtreecommitdiff
path: root/src/backend/utils
Commit message (Collapse)AuthorAgeFilesLines
* Aggregate functions now support multiple input arguments. I also tookTom Lane2006-07-271-5/+19
| | | | | | | | the opportunity to treat COUNT(*) as a zero-argument aggregate instead of the old hack that equated it to COUNT(1); this is materially cleaner (no more weird ANYOID cases) and ought to be at least a tiny bit faster. Original patch by Sergey Koposov; review, documentation, simple regression tests, pg_dump and psql support by moi.
* Allow units to be specified with configuration settings.Peter Eisentraut2006-07-272-58/+244
|
* Work around bug in strxfmt() but in MS VS2005.Bruce Momjian2006-07-261-2/+10
| | | | William ZHANG
* When a GUC string variable is not set, print the empty string (in SHOW etc.),Peter Eisentraut2006-07-261-2/+2
| | | | | | not "unset". An "unset" state doesn't really exist; all variables behave like an empty string value if the string being pointed to has not been initialized.
* Convert effective_cache_size to an integer, for better integration withPeter Eisentraut2006-07-261-12/+12
| | | | upcoming units feature.
* Remove hard-wired lists of timezone abbreviations in favor of providingTom Lane2006-07-255-406/+675
| | | | | | | | | configuration files that can be altered by a DBA. The australian_timezones GUC setting disappears, replaced by a timezone_abbreviations setting (set this to 'Australia' to get the effect of australian_timezones). The list of zone names defined by default has undergone a bit of cleanup, too. Documentation still needs some work --- in particular, should we fix Table B-4, or just get rid of it? Joachim Wieland, with some editorializing by moi.
* DTrace support, with a small initial set of probesPeter Eisentraut2006-07-241-0/+24
| | | | by Robert Lor
* Mark postgresql.conf entries that require server restart; some minorPeter Eisentraut2006-07-241-36/+54
| | | | editing and reformatting.
* Add a fudge factor to genericcostestimate() to prevent the planner fromTom Lane2006-07-241-1/+19
| | | | | | | thinking that indexes of different sizes are equally attractive. Per gripe from Jim Nasby. (I remain unconvinced that there's such a problem in existing releases, but CVS HEAD definitely has got a problem because of its new count-only-leaf-pages approach to indexscan costing.)
* Convert the lock manager to use the new dynahash.c support for partitionedTom Lane2006-07-231-2/+2
| | | | | hash tables, instead of the previous kluge involving multiple hash tables. This partially undoes my patch of last December.
* Add support to dynahash.c for partitioning shared hashtables accordingTom Lane2006-07-221-72/+356
| | | | | | to the low-order bits of the entry hash value. Also make some incidental cleanups in the dynahash API, such as not exporting the hash header structs to the world.
* Add the full set of comparison functions for type TID, including a btreeTom Lane2006-07-211-13/+91
| | | | | | | | opclass. This is not so much because anyone's likely to create an index on TID, as that sorting TIDs can be useful. Also added max and min aggregates while at it, so that one can investigate the clusteredness of a table with queries like SELECT min(ctid), max(ctid) FROM tab WHERE ... Greg Stark and Tom Lane
* Fix some makefiles that fail to yield good results from 'make -qp'.Tom Lane2006-07-151-2/+2
| | | | | This doesn't really matter for ordinary building of Postgres, but it's useful for automated checks, such as my just-committed pgcheckdefines.
* Fix another passel of include-file breakage. Kris Jurka, Tom LaneTom Lane2006-07-143-3/+6
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-1445-160/+45
|
* Fix a passel of recently-committed violations of the rule 'thou shaltTom Lane2006-07-145-10/+5
| | | | | have no other gods before c.h'. Also remove some demonstrably redundant #include lines, mostly of <errno.h> which was added to c.h years ago.
* More include file adjustments.Bruce Momjian2006-07-131-1/+2
|
* Allow include files to compile own their own.Bruce Momjian2006-07-1312-15/+26
| | | | | | | Strip unused include files out unused include files, and add needed includes to C files. The next step is to remove unused include files in C files.
* Alphabetically order reference to include files, "S"-"Z".Bruce Momjian2006-07-115-30/+30
|
* Alphabetically order reference to include files, "N" - "S".Bruce Momjian2006-07-113-6/+6
|
* Alphabetically order reference to include files, "G" - "M".Bruce Momjian2006-07-112-8/+8
|
* Sort reference of include files, "A" - "F".Bruce Momjian2006-07-116-12/+12
|
* Improve vacuum code to track minimum Xids per table instead of per database.Alvaro Herrera2006-07-101-15/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | To this end, add a couple of columns to pg_class, relminxid and relvacuumxid, based on which we calculate the pg_database columns after each vacuum. We now force all databases to be vacuumed, even template ones. A backend noticing too old a database (meaning pg_database.datminxid is in danger of falling behind Xid wraparound) will signal the postmaster, which in turn will start an autovacuum iteration to process the offending database. In principle this is only there to cope with frozen (non-connectable) databases without forcing users to set them to connectable, but it could force regular user database to go through a database-wide vacuum at any time. Maybe we should warn users about this somehow. Of course the real solution will be to use autovacuum all the time ;-) There are some additional improvements we could have in this area: for example the vacuum code could be smarter about not updating pg_database for each table when called by autovacuum, and do it only once the whole autovacuum iteration is done. I updated the system catalogs documentation, but I didn't modify the maintenance section. Also having some regression tests for this would be nice but it's not really a very straightforward thing to do. Catalog version bumped due to system catalog changes.
* Fix typos in comments.Neil Conway2006-07-041-3/+3
|
* Code review for FILLFACTOR patch. Change WITH grammar as per earlierTom Lane2006-07-032-123/+184
| | | | | | | | | | | | | | | | discussion (including making def_arg allow reserved words), add missed opt_definition for UNIQUE case. Put the reloptions support code in a less random place (I chose to make a new file access/common/reloptions.c). Eliminate header inclusion creep. Make the index options functions safely user-callable (seems like client apps might like to be able to test validity of options before trying to make an index). Reduce overhead for normal case with no options by allowing rd_options to be NULL. Fix some unmaintainably klugy code, including getting rid of Natts_pg_class_fixed at long last. Some stylistic cleanup too, and pay attention to keeping comments in sync with code. Documentation still needs work, though I did fix the omissions in catalogs.sgml and indexam.sgml.
* Add FILLFACTOR to CREATE INDEX.Bruce Momjian2006-07-022-57/+174
| | | | ITAGAKI Takahiro
* Fix oversight in planning for multiple indexscans driven byTom Lane2006-07-011-8/+81
| | | | | | | | ScalarArrayOpExpr index quals: we were estimating the right total number of rows returned, but treating the index-access part of the cost as if a single scan were fetching that many consecutive index tuples. Actually we should treat it as a multiple indexscan, and if there are enough of 'em the Mackert-Lohman discount should kick in.
* Fix typo in comment.Neil Conway2006-06-281-4/+4
|
* Remove embedded newline in string literal --- seems to make newer gccTom Lane2006-06-271-3/+2
| | | | versions very unhappy, and shouldn't be there anyway.
* Add GUC update_process_title to control whether 'ps' display is updatedBruce Momjian2006-06-273-4/+24
| | | | for every command, default to on.
* Default stats_command_string to 'on', now that its overhead is minimal.Bruce Momjian2006-06-272-3/+3
|
* Extend the MinimalTuple concept to tuplesort.c, thereby reducing theTom Lane2006-06-271-120/+112
| | | | | | | | | 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.
* Create infrastructure for 'MinimalTuple' representation of in-memoryTom Lane2006-06-271-26/+104
| | | | | | | | 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.
* Update comment description of geo routines and move comment to moreBruce Momjian2006-06-261-11/+10
| | | | relevant location.
* Tweak dynahash.c to avoid wasting memory space in non-shared hash tables.Tom Lane2006-06-251-8/+43
| | | | | | | | 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.
* Standalone backends need pgstat_bestart() too, per Qingqing Zhou.Tom Lane2006-06-221-2/+2
|
* Remove redundant gettimeofday() calls to the extent practical withoutTom Lane2006-06-203-8/+61
| | | | | | | | | | | changing semantics too much. statement_timestamp is now set immediately upon receipt of a client command message, and the various places that used to do their own gettimeofday() calls to mark command startup are referenced to that instead. I have also made stats_command_string use that same value for pg_stat_activity.query_start for both the command itself and its eventual replacement by <IDLE> or <idle in transaction>. There was some debate about that, but no argument that seemed convincing enough to justify an extra gettimeofday() call.
* Split definitions for md5.c out of crypt.h and into their own headerTom Lane2006-06-201-2/+2
| | | | | | | | | libpq/md5.h, so that there's a clear separation between backend-only definitions and shared frontend/backend definitions. (Turns out this is reversing a bad decision from some years ago...) Fix up references to crypt.h as needed. I looked into moving the code into src/port, but the headers in src/include/libpq are sufficiently intertwined that it seems more work than it's worth to do that.
* Take the statistics collector out of the loop for monitoring backends'Tom Lane2006-06-193-155/+101
| | | | | | | current commands; instead, store current-status information in shared memory. This substantially reduces the overhead of stats_command_string and also ensures that pg_stat_activity is fully up to date at all times. Per my recent proposal.
* Fix problems with cached tuple descriptors disappearing while still in useTom Lane2006-06-167-48/+226
| | | | | | | | | | by creating a reference-count mechanism, similar to what we did a long time ago for catcache entries. The back branches have an ugly solution involving lots of extra copies, but this way is more efficient. Reference counting is only applied to tupdescs that are actually in caches --- there seems no need to use it for tupdescs that are generated in the executor, since they'll go away during plan shutdown by virtue of being in the per-query memory context. Neil Conway and Tom Lane
* Remove the limit on the number of entries allowed in catcaches, andTom Lane2006-06-152-193/+173
| | | | | | | | | | | | | | | | | | remove the infrastructure needed to enforce the limit, ie, the global LRU list of cache entries. On small-to-middling databases this wins because maintaining the LRU list is a waste of time. On large databases this wins because it's better to keep more cache entries (we assume such users can afford to use some more per-backend memory than was contemplated in the Berkeley-era catcache design). This provides a noticeable improvement in the speed of psql \d on a 10000-table database, though it doesn't make it instantaneous. While at it, use per-catcache settings for the number of hash buckets per catcache, rather than the former one-size-fits-all value. It's a bit silly to be using the same number of hash buckets for, eg, pg_am and pg_attribute. The specific values I used might need some tuning, but they seem to be in the right ballpark based on CATCACHE_STATS results from the standard regression tests.
* Avoid use of C commment inside C comment from recent Win32 int overflow patch.Bruce Momjian2006-06-121-3/+3
|
* Win32 can't catch the exception thrown by INT_MIN / -1 or INT_MIN * -1,Bruce Momjian2006-06-121-1/+23
| | | | | | | so on that platform we test for those before the computation and throw an "out of range" error. Backpatch to 8.1.X.
* Minor code cleanup: make the WIN32 case less gratuitously different fromTom Lane2006-06-121-33/+24
| | | | the other platform-specific cases in ps_status.
* Allow timezone names in SQL strings,Bruce Momjian2006-06-071-5/+66
| | | | | | '2006-05-24 21:11 Americas/New_York'::timestamptz Joachim Wieland
* Prepare code to be built by MSVC:Bruce Momjian2006-06-073-5/+15
| | | | | | | | | | o remove many WIN32_CLIENT_ONLY defines o add WIN32_ONLY_COMPILER define o add 3rd argument to open() for portability o add include/port/win32_msvc directory for system includes Magnus Hagander
* Make the planner estimate costs for nestloop inner indexscans on the basisTom Lane2006-06-061-34/+74
| | | | | | | | | | | | | | | | | | | | | that the Mackert-Lohmann formula applies across all the repetitions of the nestloop, not just each scan independently. We use the M-L formula to estimate the number of pages fetched from the index as well as from the table; that isn't what it was designed for, but it seems reasonably applicable anyway. This makes large numbers of repetitions look much cheaper than before, which accords with many reports we've received of overestimation of the cost of a nestloop. Also, change the index access cost model to charge random_page_cost per index leaf page touched, while explicitly not counting anything for access to metapage or upper tree pages. This may all need tweaking after we get some field experience, but in simple tests it seems to be giving saner results than before. The main thing is to get the infrastructure in place to let cost_index() and amcostestimate functions take repeated scans into account at all. Per my recent proposal. Note: this patch changes pg_proc.h, but I did not force initdb because the changes are basically cosmetic --- the system does not look into pg_proc to decide how to call an index amcostestimate function, and there's no way to call such a function from SQL at all.
* Increase the default value of cpu_index_tuple_cost from 0.001 to 0.005.Tom Lane2006-06-051-1/+1
| | | | | | This shouldn't affect simple indexscans much, while for bitmap scans that are touching a lot of index rows, this seems to bring the estimates more in line with reality. Per recent discussion.
* Add a GUC parameter seq_page_cost, and use that everywhere we formerlyTom Lane2006-06-053-32/+38
| | | | | | | | assumed that a sequential page fetch has cost 1.0. This patch doesn't in itself change the system's behavior at all, but it opens the door to people adopting other units of measurement for EXPLAIN costs. Also, if we ever decide it's worth inventing per-tablespace access cost settings, this change provides a workable intellectual framework for that.
* Don't choke during startup if the environment offers an invalid valueTom Lane2006-06-031-2/+17
| | | | | | | | | | for LC_MESSAGES; instead, just press forward, leaving the effective setting at 'C'. There is not any very good reason to complain when we are going to replace the value soon with whatever postgresql.conf says. This change should solve the occasionally-reported problem of initdb failing with 'failed to initialize lc_messages'; the current theory is that that is a reflection of either wrong LANG/LC_MESSAGES or completely broken locale support.