summaryrefslogtreecommitdiff
path: root/src/backend/access/gist
AgeCommit message (Collapse)Author
2006-09-21Fix free space map to correctly track the total amount of FSM space neededTom Lane
even when a single relation requires more than max_fsm_pages pages. Also, make VACUUM emit a warning in this case, since it likely means that VACUUM FULL or other drastic corrective measure is needed. Per reports from Jeff Frost and others of unexpected changes in the claimed max_fsm_pages need.
2006-09-10Rename contains/contained-by operators to @> and <@, per discussion thatTom Lane
agreed these symbols are less easily confused. I made new pg_operator entries (with new OIDs) for the old names, so as to provide backward compatibility while making it pretty easy to remove the old names in some future release cycle. This commit only touches the core datatypes, contrib will be fixed separately.
2006-08-07Make recovery from WAL be restartable, by executing a checkpoint-likeTom Lane
operation every so often. This improves the usefulness of PITR log shipping for hot standby: formerly, if the standby server crashed, it was necessary to restart it from the last base backup and replay all the WAL since then. Now it will only need to reread about the same amount of WAL as the master server would. The behavior might also come in handy during a long PITR replay sequence. Simon Riggs, with some editorialization by Tom Lane.
2006-07-31Change the relation_open protocol so that we obtain lock on a relationTom Lane
(table or index) before trying to open its relcache entry. This fixes race conditions in which someone else commits a change to the relation's catalog entries while we are in process of doing relcache load. Problems of that ilk have been reported sporadically for years, but it was not really practical to fix until recently --- for instance, the recent addition of WAL-log support for in-place updates helped. Along the way, remove pg_am.amconcurrent: all AMs are now expected to support concurrent update.
2006-07-14Remove 576 references of include files that were not needed.Bruce Momjian
2006-07-11Alphabetically order reference to include files, "G" - "M".Bruce Momjian
2006-07-03Code review for FILLFACTOR patch. Change WITH grammar as per earlierTom Lane
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.
2006-07-02Add FILLFACTOR to CREATE INDEX.Bruce Momjian
ITAGAKI Takahiro
2006-06-28Forget to add new file :((Teodor Sigaev
2006-06-28ChangesTeodor Sigaev
* 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-05-29Som improve page split in multicolumn GiST index.Teodor Sigaev
If user picksplit on n-th column generate equals left and right unions then it calls picksplit on n+1-th column.
2006-05-24* Add support NULL to GiST.Teodor Sigaev
* some refactoring and simplify code int gistutil.c and gist.c * now in some cases it can be called used-defined picksplit method for non-first column in index, but here is a place to do more. * small fix of docs related to support NULL.
2006-05-19Call MarkBufferDirty() before XLogInsert() during completion of insertTeodor Sigaev
2006-05-19Simplify gistSplit() and some refactoring related code.Teodor Sigaev
2006-05-19Rework completion of incomplete inserts. Now it writesTeodor Sigaev
WAL log during inserts.
2006-05-17Reduce size of critial section during vacuum full, criticalTeodor Sigaev
sections now isn't nested. All user-defined functions now is called outside critsections. Small improvements in WAL protocol. TODO: improve XLOG replay
2006-05-10Clean up code associated with updating pg_class statistics columnsTom Lane
(relpages/reltuples). To do this, create formal support in heapam.c for "overwrite" tuple updates (including xlog replay capability) and use that instead of the ad-hoc overwrites we'd been using in VACUUM and CREATE INDEX. Take the responsibility for updating stats during CREATE INDEX out of the individual index AMs, and do it where it belongs, in catalog/index.c. Aside from being more modular, this avoids having to update the same tuple twice in some paths through CREATE INDEX. It's probably not measurably faster, but for sure it's a lot cleaner than before.
2006-05-10Reduce size of critical section and remove call of user-defined functions inTeodor Sigaev
insertion and deletion, modify gistSplit() to do not use buffers. TODO: gistvacuumcleanup and XLOG
2006-05-02Clean up API for ambulkdelete/amvacuumcleanup as per today's discussion.Tom Lane
This formulation requires every AM to provide amvacuumcleanup, unlike before, but it's surely a whole lot cleaner. Also, add an 'amstorage' column to pg_am so that we can get rid of hardwired knowledge in DefineOpClass().
2006-04-03Fix thinko in gistRedoPageUpdateRecord: if XLR_BKP_BLOCK_1 is set, weTom Lane
don't have anything to do to the page, but we still have to adjust the incomplete_inserts list that we're maintaining in memory.
2006-04-03Eliminate ajust scan code. Since concurrent GiST it doesn'tTeodor Sigaev
do real work. That was missed during concurrence development.
2006-03-31Clean up WAL/buffer interactions as per my recent proposal. Get rid of theTom Lane
misleadingly-named WriteBuffer routine, and instead require routines that change buffer pages to call MarkBufferDirty (which does exactly what it says). We also require that they do so before calling XLogInsert; this takes care of the synchronization requirement documented in SyncOneBuffer. Note that because bufmgr takes the buffer content lock (in shared mode) while writing out any buffer, it doesn't matter whether MarkBufferDirty is executed before the buffer content change is complete, so long as the content change is completed before releasing exclusive lock on the buffer. So it's OK to set the dirtybit before we fill in the LSN. This eliminates the former kluge of needing to set the dirtybit in LockBuffer. Aside from making the code more transparent, we can also add some new debugging assertions, in particular that the caller of MarkBufferDirty must hold the buffer content lock, not merely a pin.
2006-03-30Improve gist XLOG code to follow the coding rules needed to preventTom Lane
torn-page problems. This introduces some issues of its own, mainly that there are now some critical sections of unreasonably broad scope, but it's a step forward anyway. Further cleanup will require some code refactoring that I'd prefer to get Oleg and Teodor involved in.
2006-03-29Clean up and document the API for XLogOpenRelation and XLogReadBuffer.Tom Lane
This commit doesn't make much functional change, but it does eliminate some duplicated code --- for instance, PageIsNew tests are now done inside XLogReadBuffer rather than by each caller. The GIST xlog code still needs a lot of love, but I'll worry about that separately.
2006-03-24Arrange to emit a description of the current XLOG record as error contextTom Lane
when an error occurs during xlog replay. Also, replace the former risky 'write into a fixed-size buffer with no overflow detection' API for XLOG record description routines; use an expansible StringInfo instead. (The latter accounts for most of the patch bulk.) Qingqing Zhou
2006-03-05Update copyright for 2006. Update scripts.Bruce Momjian
2006-02-14Add some missing vacuum_delay_point calls in GIST vacuuming.Tom Lane
2006-02-11Skip ambulkdelete scan if there's nothing to delete and the index is notTom Lane
partial. None of the existing AMs do anything useful except counting tuples when there's nothing to delete, and we can get a tuple count from the heap as long as it's not a partial index. (hash actually can skip anyway because it maintains a tuple count in the index metapage.) GIST is not currently able to exploit this optimization because, due to failure to index NULLs, GIST is always effectively partial. Possibly we should fix that sometime. Simon Riggs w/ some review by Tom Lane.
2006-02-11Revert based on Tom's recommendation:Bruce Momjian
> Allow VACUUM to complete faster by avoiding scanning the indexes when no > rows were removed from the heap by the VACUUM.
2006-02-11Allow VACUUM to complete faster by avoiding scanning the indexes when noBruce Momjian
rows were removed from the heap by the VACUUM. Simon Riggs
2006-01-14Some minor code cleanup, falling out from the removal of rtree. SK_NEGATETom Lane
isn't being used anywhere anymore, and there seems no point in a generic index_keytest() routine when two out of three remaining access methods aren't using it. Also, add a comment documenting a convention for letting access methods define private flag bits in ScanKey sk_flags. There are no such flags at the moment but I'm thinking about changing btree's handling of "required keys" to use flag bits in the keys rather than a count of required key positions. Also, if some AM did still want SK_NEGATE then it would be reasonable to treat it as a private flag bit.
2005-11-22Re-run pgindent, fixing a problem where comment lines after a blankBruce Momjian
comment line where output as too long, and update typedefs for /lib directory. Also fix case where identifiers were used as variable names in the backend, but as typedefs in ecpg (favor the backend for indenting). Backpatch to 8.1.X.
2005-11-07R-tree is dead ... long live GiST.Tom Lane
2005-11-06Add simple sanity checks on newly-read pages to GiST, too.Tom Lane
2005-10-18A few trivial code cleanups motivated by reading warnings generatedTom Lane
by a recent HP C compiler. Mostly, get rid of useless local variables that are assigned to but never used.
2005-10-15Standard pgindent run for 8.1.Bruce Momjian
2005-10-06Revise pgstats stuff to fix the problems with not counting accessesTom Lane
generated by bitmap index scans. Along the way, simplify and speed up the code for counting sequential and index scans; it was both confusing and inefficient to be taking care of that in the per-tuple loops, IMHO. initdb forced because of internal changes in pg_stat view definitions.
2005-09-22pgindent new GIST index code, per request from Tom.Bruce Momjian
2005-09-22Adjust GiST error messages to conform to message style guidelines.Tom Lane
2005-09-16Small fixesTeodor Sigaev
2005-09-15Copy-editing for GiST README.Neil Conway
2005-09-15Readme about GiST's algorithmsTeodor Sigaev
2005-09-02Clean up a couple of ad-hoc computations of the maximum number of tuplesTom Lane
on a page, as suggested by ITAGAKI Takahiro. Also, change a few places that were using some other estimates of max-items-per-page to consistently use MaxOffsetNumber. This is conservatively large --- we could have used the new MaxHeapTuplesPerPage macro, or a similar one for index tuples --- but those places are simply declaring a fixed-size buffer and assuming it will work, rather than actively testing for overrun. It seems safer to size these buffers in a way that can't overflow even if the page is corrupt.
2005-07-01Migrate rtree_gist functionality into the core system, and add someTom Lane
basic regression tests for GiST to the standard regression tests. I took the opportunity to add an rtree-equivalent gist opclass for circles; the contrib version only covered boxes and polygons, but indexing circles is very handy for distance searches.
2005-07-01Improve error messages and add commentTeodor Sigaev
2005-06-30Bug fixes for GiST crash recovery.Teodor Sigaev
- add forgotten check of lsn for insert completion - remove level of pages: hard to check in recovery - some cleanups
2005-06-29Cleanup, remove unneeded pallocsTeodor Sigaev
2005-06-28Code cleanup. gistfillbuffer accepts InvalidOffsetNumber.Teodor Sigaev
2005-06-27Concurrency for GiSTTeodor Sigaev
- full concurrency for insert/update/select/vacuum: - select and vacuum never locks more than one page simultaneously - select (gettuple) hasn't any lock across it's calls - insert never locks more than two page simultaneously: - during search of leaf to insert it locks only one page simultaneously - while walk upward to the root it locked only parent (may be non-direct parent) and child. One of them X-lock, another may be S- or X-lock - 'vacuum full' locks index - improve gistgetmulti - simplify XLOG records Fix bug in index_beginscan_internal: LockRelation may clean rd_aminfo structure, so move GET_REL_PROCEDURE after LockRelation
2005-06-20fix founded hole in recovery after crash, add vacuum_delay_point()Teodor Sigaev