summaryrefslogtreecommitdiff
path: root/contrib/pgstattuple/pgstattuple.c
AgeCommit message (Collapse)Author
2007-10-22Be careful to get share lock on each page before computing its free space.Tom Lane
ITAGAKI Takahiro
2007-09-20HOT updates. When we update a tuple without changing any of its indexedTom Lane
columns, and the new version can be stored on the same heap page, we no longer generate extra index entries for the new version. Instead, index searches follow the HOT-chain links to ensure they find the correct tuple version. In addition, this patch introduces the ability to "prune" dead tuples on a per-page basis, without having to do a complete VACUUM pass to recover space. VACUUM is still needed to clean up dead index entries, however. Pavan Deolasee, with help from a bunch of other people.
2007-09-12Redefine the lp_flags field of item pointers as having four states, ratherTom Lane
than two independent bits (one of which was never used in heap pages anyway, or at least hadn't been in a very long time). This gives us flexibility to add the HOT notions of redirected and dead item pointers without requiring anything so klugy as magic values of lp_off and lp_len. The state values are chosen so that for the states currently in use (pre-HOT) there is no change in the physical representation.
2007-08-26Restrict pgstattuple functions to superusers. (This might be too strict,Tom Lane
but no permissions check at all is certainly no good.) Clean up usage of some deprecated APIs.
2007-05-03Tweak hash index AM to use the new ReadOrZeroBuffer bufmgr API when fetchingTom Lane
pages it intends to zero immediately. Just to show there is some use for that function besides WAL recovery :-). Along the way, fold _hash_checkpage and _hash_pageinit calls into _hash_getbuf and friends, instead of expecting callers to do that separately.
2007-03-25Clean up the representation of special snapshots by including a "methodTom Lane
pointer" in every Snapshot struct. This allows removal of the case-by-case tests in HeapTupleSatisfiesVisibility, which should make it a bit faster (I didn't try any performance tests though). More importantly, we are no longer violating portable C practices by assuming that small integers are distinct from all pointer values, and HeapTupleSatisfiesDirty no longer has a non-reentrant API involving side-effects on a global variable. There were a couple of places calling HeapTupleSatisfiesXXX routines directly rather than through the HeapTupleSatisfiesVisibility macro. Since these places had to be changed anyway, I chose to make them go through the macro for uniformity. Along the way I renamed HeapTupleSatisfiesSnapshot to HeapTupleSatisfiesMVCC to emphasize that it's only used with MVCC-type snapshots. I was sorely tempted to rename HeapTupleSatisfiesVisibility to HeapTupleSatisfiesSnapshot, but forebore for the moment to avoid confusion and reduce the likelihood that this patch breaks some of the pending patches. Might want to reconsider doing that later.
2006-10-04pgindent run for 8.2.Bruce Momjian
2006-09-04Clean up some leftover problems in pgstattuple: remove unwanted andTom Lane
unportable elog(NOTICE) report, fix install/uninstall sequence. Itagaki Takahiro
2006-07-11Alphabetically order reference to include files, "N" - "S".Bruce Momjian
2006-07-06Add index information to /contrib/pgstattuple:Bruce Momjian
This is an extension of pgstattuple to query information from indexes. It supports btree, hash and gist. Gin is not supported. It scans only index pages and does not read corresponding heap tuples. Therefore, 'dead_tuple' means the number of tuples with LP_DELETE flag. Also, I added an experimental feature for btree indexes. It checks fragmentation factor of indexes. If an leaf has the right link on the next adjacent page in the file, it is assumed to be continuous (not fragmented). It will help us to decide when to REINDEX. ITAGAKI Takahiro
2006-05-30Magic blocks don't do us any good unless we use 'em ... so install oneTom Lane
in every shared library.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-05-30Document get_call_result_type() and friends; mark TypeGetTupleDesc()Tom Lane
and RelationNameGetTupleDesc() as deprecated; remove uses of the latter in the contrib library. Along the way, clean up crosstab() code and documentation a little.
2005-05-27Remove second argument from textToQualifiedNameList(), as it is no longerNeil Conway
used. From Jaime Casanova.
2004-10-15Repair possible failure to update hint bits back to disk, perTom Lane
http://archives.postgresql.org/pgsql-hackers/2004-10/msg00464.php. This fix is intended to be permanent: it moves the responsibility for calling SetBufferCommitInfoNeedsSave() into the tqual.c routines, eliminating the requirement for callers to test whether t_infomask changed. Also, tighten validity checking on buffer IDs in bufmgr.c --- several routines were paranoid about out-of-range shared buffer numbers but not about out-of-range local ones, which seems a tad pointless.
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-05-08Get rid of rd_nblocks field in relcache entries. Turns out this wasTom Lane
costing us lots more to maintain than it was worth. On shared tables it was of exactly zero benefit because we couldn't trust it to be up to date. On temp tables it sometimes saved an lseek, but not often enough to be worth getting excited about. And the real problem was that we forced an lseek on every relcache flush in order to update the field. So all in all it seems best to lose the complexity.
2004-04-01Replace TupleTableSlot convention for whole-row variables and functionTom Lane
results with tuples as ordinary varlena Datums. This commit does not in itself do much for us, except eliminate the horrid memory leak associated with evaluation of whole-row variables. However, it lays the groundwork for allowing composite types as table columns, and perhaps some other useful features as well. Per my proposal of a few days ago.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-08-04pgindent run.Bruce Momjian
2003-08-01Fix some minor portability issues, per Chris K-L.Tom Lane
2003-06-12New patch with corrected README attached.Bruce Momjian
Also quickly added mention that it may be a qualified schema name. Rod Taylor
2002-09-04pgindent run.Bruce Momjian
2002-08-29Adjust nodeFunctionscan.c to reset transient memory context between callsTom Lane
to the table function, thus preventing memory leakage accumulation across calls. This means that SRFs need to be careful to distinguish permanent and local storage; adjust code and documentation accordingly. Patch by Joe Conway, very minor tweaks by Tom Lane.
2002-08-23Adapt for SRF(Set Returning Function).Tatsuo Ishii
2002-05-20Restructure indexscan API (index_beginscan, index_getnext) perTom Lane
yesterday's proposal to pghackers. Also remove unnecessary parameters to heap_beginscan, heap_rescan. I modified pg_proc.h to reflect the new numbers of parameters for the AM interface routines, but did not force an initdb because nothing actually looks at those fields.
2002-03-30Further cleanups for relations in schemas: teach nextval and otherTom Lane
sequence functions how to cope with qualified names. Same code is also used for int4notin, currtid_byrelname, pgstattuple. Also, move TOAST tables into special pg_toast namespace.
2002-03-06Change made to elog:Bruce Momjian
o Change all current CVS messages of NOTICE to WARNING. We were going to do this just before 7.3 beta but it has to be done now, as you will see below. o Change current INFO messages that should be controlled by client_min_messages to NOTICE. o Force remaining INFO messages, like from EXPLAIN, VACUUM VERBOSE, etc. to always go to the client. o Remove INFO from the client_min_messages options and add NOTICE. Seems we do need three non-ERROR elog levels to handle the various behaviors we need for these messages. Regression passed.
2001-12-19Fix pgstattuple to acquire a read lock on the target table. ThisTom Lane
prevents embarassments such as having the table dropped or truncated partway through the scan. Also, fix free space calculation to include pages that currently contain no tuples.
2001-10-25pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian
tests pass.
2001-10-01Add pgstattupleTatsuo Ishii