summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
AgeCommit message (Collapse)Author
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-19Simplify gistSplit() and some refactoring related code.Teodor Sigaev
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-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-05Update copyright for 2006. Update scripts.Bruce Momjian
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-09-22pgindent new GIST index code, per request from Tom.Bruce Momjian
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
2005-06-201. full functional WAL for GiSTTeodor Sigaev
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
2005-06-14WAL for GiST. It work for online backup and so on, but onTeodor Sigaev
recovery after crash (power loss etc) it may say that it can't restore index and index should be reindexed. Some refactoring code.
2005-06-06Remove the mostly-stubbed-out-anyway support routines for WAL UNDO.Tom Lane
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.
2005-05-17Cleanup GiST header files. Since GiST extensions are often written asNeil Conway
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.
2005-05-17GiST improvements:Neil Conway
- 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
2005-05-15Various style cleanups for GiST; no changes to functionality.Neil Conway
2005-05-11This patch refactors away some duplicated code in the index AM buildNeil Conway
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.
2005-03-21Convert index-related tuple handling routines from char 'n'/' ' to boolTom Lane
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...
2004-12-31Tag appropriate files for rc3PostgreSQL Daemon
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 ...
2004-08-29Pgindent run for 8.0.Bruce Momjian
2004-08-29Update copyright to 2004.Bruce Momjian
2004-03-30Cleanup vectors of GISTENTRY and eliminate problem with 64-bit strict-alignedTeodor Sigaev
boxes. Change interface to user-defined GiST support methods union and picksplit. Now instead of bytea struct it used special GistEntryVector structure.
2004-02-10Centralize implementation of delay code by creating a pg_usleep()Tom Lane
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?
2004-01-07More janitorial work: remove the explicit casting of NULL literals to aNeil Conway
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.
2003-11-29$Header: -> $PostgreSQL Changes ...PostgreSQL Daemon
2003-08-04Update copyrights to 2003.Bruce Momjian
2003-07-21Error message editing in backend/access.Tom Lane
2003-05-27Make debug_ GUC varables output DEBUG1 rather than LOG, and mention inBruce Momjian
docs that CLIENT/LOG_MIN_MESSAGES now controls debug_* output location. Doc changes included.
2003-03-10This patch fixes a bunch of spelling mistakes in comments throughout theTom Lane
PostgreSQL source code. Neil Conway
2003-02-24During VACUUM FULL, truncate off any deletable pages that are at theTom Lane
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.
2003-02-22More infrastructure for btree compaction project. Tree-traversal codeTom Lane
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.
2002-11-13Add new palloc0 call as merge of palloc and MemSet(0).Bruce Momjian
2002-11-11Back out use of palloc0 in place if palloc/MemSet. Seems constant lenBruce Momjian
to MemSet is a performance boost.
2002-11-10Merge palloc()/MemSet(0) calls into a single palloc0() call.Bruce Momjian
2002-09-04pgindent run.Bruce Momjian
2002-06-20Update copyright to 2002.Bruce Momjian
2002-05-28Repair error with not adjusting active scans properly after gistSplit.Tom Lane
Patch from Teodor Sigaev.
2002-05-24Mark index entries "killed" when they are no longer visible to anyTom Lane
transaction, so as to avoid returning them out of the index AM. Saves repeated heap_fetch operations on frequently-updated rows. Also detect queries on unique keys (equality to all columns of a unique index), and don't bother continuing scan once we have found first match. Killing is implemented in the btree and hash AMs, but not yet in rtree or gist, because there isn't an equally convenient place to do it in those AMs (the outer amgetnext routine can't do it without re-pinning the index page). Did some small cleanup on APIs of HeapTupleSatisfies, heap_fetch, and index_insert to make this a little easier.
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-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.
2002-03-05I was digging through the GiST code, and figured I'd fix up some of theBruce Momjian
"bad smell" in that code. Stuff like function parameters that aren't used, typos in the comments, comparison between signed and unsigned ints, etc. Attached is a pretty trivial patch; it compiles, but beyond that completely untested. Unless anyone sees any problems, please apply for 7.3. Neil Conway