summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
Commit message (Collapse)AuthorAgeFilesLines
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-051-2/+2
| | | | back-stamped for this.
* Fix some typos in comments.Neil Conway2006-11-121-6/+6
|
* pgindent run for 8.2.Bruce Momjian2006-10-041-70/+81
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-141-4/+1
|
* Code review for FILLFACTOR patch. Change WITH grammar as per earlierTom Lane2006-07-031-9/+11
| | | | | | | | | | | | | | | | 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-021-5/+12
| | | | ITAGAKI Takahiro
* ChangesTeodor Sigaev2006-06-281-162/+20
| | | | | | | | | | | | | | | | | | | | * 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
* Som improve page split in multicolumn GiST index.Teodor Sigaev2006-05-291-2/+8
| | | | | | If user picksplit on n-th column generate equals left and right unions then it calls picksplit on n+1-th column.
* * Add support NULL to GiST.Teodor Sigaev2006-05-241-108/+148
| | | | | | | | * 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.
* Simplify gistSplit() and some refactoring related code.Teodor Sigaev2006-05-191-103/+42
|
* Reduce size of critial section during vacuum full, criticalTeodor Sigaev2006-05-171-4/+4
| | | | | | | | sections now isn't nested. All user-defined functions now is called outside critsections. Small improvements in WAL protocol. TODO: improve XLOG replay
* Clean up code associated with updating pg_class statistics columnsTom Lane2006-05-101-5/+11
| | | | | | | | | | | (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.
* Reduce size of critical section and remove call of user-defined functions inTeodor Sigaev2006-05-101-218/+175
| | | | | | insertion and deletion, modify gistSplit() to do not use buffers. TODO: gistvacuumcleanup and XLOG
* Eliminate ajust scan code. Since concurrent GiST it doesn'tTeodor Sigaev2006-04-031-6/+1
| | | | do real work. That was missed during concurrence development.
* Clean up WAL/buffer interactions as per my recent proposal. Get rid of theTom Lane2006-03-311-41/+37
| | | | | | | | | | | | | | | | 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.
* Improve gist XLOG code to follow the coding rules needed to preventTom Lane2006-03-301-52/+53
| | | | | | | 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.
* Update copyright for 2006. Update scripts.Bruce Momjian2006-03-051-2/+2
|
* Add simple sanity checks on newly-read pages to GiST, too.Tom Lane2005-11-061-12/+18
|
* A few trivial code cleanups motivated by reading warnings generatedTom Lane2005-10-181-4/+2
| | | | | by a recent HP C compiler. Mostly, get rid of useless local variables that are assigned to but never used.
* pgindent new GIST index code, per request from Tom.Bruce Momjian2005-09-221-352/+468
|
* Bug fixes for GiST crash recovery.Teodor Sigaev2005-06-301-13/+12
| | | | | | - add forgotten check of lsn for insert completion - remove level of pages: hard to check in recovery - some cleanups
* Cleanup, remove unneeded pallocsTeodor Sigaev2005-06-291-1/+2
|
* Code cleanup. gistfillbuffer accepts InvalidOffsetNumber.Teodor Sigaev2005-06-281-10/+5
|
* Concurrency for GiSTTeodor Sigaev2005-06-271-99/+384
| | | | | | | | | | | | | | | | | | - 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
* fix founded hole in recovery after crash, add vacuum_delay_point()Teodor Sigaev2005-06-201-36/+20
|
* 1. full functional WAL for GiSTTeodor Sigaev2005-06-201-411/+164
| | | | | | | | | | | 2. improve vacuum for gist - use FSM - full vacuum: - reforms parent tuple if it's needed ( tuples was deleted on child page or parent tuple remains invalid after crash recovery ) - truncate index file if possible 3. fixes bugs and mistakes
* WAL for GiST. It work for online backup and so on, but onTeodor Sigaev2005-06-141-1073/+457
| | | | | | | recovery after crash (power loss etc) it may say that it can't restore index and index should be reindexed. Some refactoring code.
* Remove the mostly-stubbed-out-anyway support routines for WAL UNDO.Tom Lane2005-06-061-7/+1
| | | | | | That code is never going to be used in the foreseeable future, and where it's more than a stub it's making the redo routines harder to read.
* Cleanup GiST header files. Since GiST extensions are often written asNeil Conway2005-05-171-4/+4
| | | | | | | | | | | | external projects, we should be careful about what parts of the GiST API are considered implementation details, and which are part of the public API. Therefore, I've moved internal-only declarations into gist_private.h -- future backward-incompatible changes to gist.h should be made with care, to avoid needlessly breaking external GiST extensions. Also did some related header cleanup: remove some unnecessary #includes from gist.h, and remove some unused definitions: isAttByVal(), _gistdump(), and GISTNStrategies.
* GiST improvements:Neil Conway2005-05-171-403/+250
| | | | | | | | | | | | | | | | | | | - make sure we always invoke user-supplied GiST methods in a short-lived memory context. This means the backend isn't exposed to any memory leaks that be in those methods (in fact, it is probably a net loss for most GiST methods to bother manually freeing memory now). This also means we can do away with a lot of ugly manual memory management in the GiST code itself. - keep the current page of a GiST index scan pinned, rather than doing a ReadBuffer() for each tuple produced by the scan. Since ReadBuffer() is expensive, this is a perf. win - implement dead tuple killing for GiST indexes (which is easy to do, now that we keep a pin on the current scan page). Now all the builtin indexes implement dead tuple killing. - cleanup a lot of ugly code in GiST
* Various style cleanups for GiST; no changes to functionality.Neil Conway2005-05-151-35/+31
|
* This patch refactors away some duplicated code in the index AM buildNeil Conway2005-05-111-22/+3
| | | | | | methods: they all invoke UpdateStats() since they have computed the number of heap tuples, so I created a function in catalog/index.c that each AM now calls.
* Convert index-related tuple handling routines from char 'n'/' ' to boolTom Lane2005-03-211-80/+48
| | | | | | | | | | convention for isnull flags. Also, remove the useless InsertIndexResult return struct from index AM aminsert calls --- there is no reason for the caller to know where in the index the tuple was inserted, and we were wasting a palloc cycle per insert to deliver this uninteresting value (plus nontrivial complexity in some AMs). I forced initdb because of the change in the signature of the aminsert routines, even though nothing really looks at those pg_proc entries...
* Tag appropriate files for rc3PostgreSQL Daemon2004-12-311-2/+2
| | | | | | | | Also performed an initial run through of upgrading our Copyright date to extend to 2005 ... first run here was very simple ... change everything where: grep 1996-2004 && the word 'Copyright' ... scanned through the generated list with 'less' first, and after, to make sure that I only picked up the right entries ...
* Pgindent run for 8.0.Bruce Momjian2004-08-291-10/+10
|
* Update copyright to 2004.Bruce Momjian2004-08-291-2/+2
|
* Cleanup vectors of GISTENTRY and eliminate problem with 64-bit strict-alignedTeodor Sigaev2004-03-301-58/+43
| | | | | | boxes. Change interface to user-defined GiST support methods union and picksplit. Now instead of bytea struct it used special GistEntryVector structure.
* Centralize implementation of delay code by creating a pg_usleep()Tom Lane2004-02-101-1/+4
| | | | | | | | | subroutine in src/port/pgsleep.c. Remove platform dependencies from miscadmin.h and put them in port.h where they belong. Extend recent vacuum cost-based-delay patch to apply to VACUUM FULL, ANALYZE, and non-btree index vacuuming. By the way, where is the documentation for the cost-based-delay patch?
* More janitorial work: remove the explicit casting of NULL literals to aNeil Conway2004-01-071-20/+19
| | | | | | | | pointer type when it is not necessary to do so. For future reference, casting NULL to a pointer type is only necessary when (a) invoking a function AND either (b) the function has no prototype OR (c) the function is a varargs function.
* $Header: -> $PostgreSQL Changes ...PostgreSQL Daemon2003-11-291-1/+1
|
* Update copyrights to 2003.Bruce Momjian2003-08-041-2/+2
|
* Error message editing in backend/access.Tom Lane2003-07-211-5/+5
|
* Make debug_ GUC varables output DEBUG1 rather than LOG, and mention inBruce Momjian2003-05-271-3/+3
| | | | | docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included.
* This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane2003-03-101-3/+3
| | | | | | PostgreSQL source code. Neil Conway
* During VACUUM FULL, truncate off any deletable pages that are at theTom Lane2003-02-241-3/+2
| | | | | | end of a btree index. This isn't super-effective, since we won't move nondeletable pages, but it's better than nothing. Also, improve stats displayed during VACUUM VERBOSE.
* More infrastructure for btree compaction project. Tree-traversal codeTom Lane2003-02-221-2/+3
| | | | | | | | now knows what to do upon hitting a dead page (in theory anyway, it's untested...). Add a post-VACUUM-cleanup entry point for index AMs, to provide a place for dead-page scavenging to happen. Also, fix oversight that broke btpo_prev links in temporary indexes. initdb forced due to additions in pg_am.
* Add new palloc0 call as merge of palloc and MemSet(0).Bruce Momjian2002-11-131-5/+3
|
* Back out use of palloc0 in place if palloc/MemSet. Seems constant lenBruce Momjian2002-11-111-3/+5
| | | | to MemSet is a performance boost.
* Merge palloc()/MemSet(0) calls into a single palloc0() call.Bruce Momjian2002-11-101-5/+3
|
* pgindent run.Bruce Momjian2002-09-041-12/+13
|