summaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
Commit message (Collapse)AuthorAgeFilesLines
...
* 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
|
* Update copyright to 2002.Bruce Momjian2002-06-201-2/+2
|
* Repair error with not adjusting active scans properly after gistSplit.Tom Lane2002-05-281-5/+9
| | | | Patch from Teodor Sigaev.
* Mark index entries "killed" when they are no longer visible to anyTom Lane2002-05-241-2/+4
| | | | | | | | | | | | | | | 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.
* Restructure indexscan API (index_beginscan, index_getnext) perTom Lane2002-05-201-13/+7
| | | | | | | 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.
* Change made to elog:Bruce Momjian2002-03-061-3/+3
| | | | | | | | | | | | | | | | | | | 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.
* I was digging through the GiST code, and figured I'd fix up some of theBruce Momjian2002-03-051-22/+20
| | | | | | | | | | | | "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
* Commit to match discussed elog() changes. Only update is that LOG isBruce Momjian2002-03-021-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | now just below FATAL in server_min_messages. Added more text to highlight ordering difference between it and client_min_messages. --------------------------------------------------------------------------- REALLYFATAL => PANIC STOP => PANIC New INFO level the prints to client by default New LOG level the prints to server log by default Cause VACUUM information to print only to the client NOTICE => INFO where purely information messages are sent DEBUG => LOG for purely server status messages DEBUG removed, kept as backward compatible DEBUG5, DEBUG4, DEBUG3, DEBUG2, DEBUG1 added DebugLvl removed in favor of new DEBUG[1-5] symbols New server_min_messages GUC parameter with values: DEBUG[5-1], INFO, NOTICE, ERROR, LOG, FATAL, PANIC New client_min_messages GUC parameter with values: DEBUG[5-1], LOG, INFO, NOTICE, ERROR, FATAL, PANIC Server startup now logged with LOG instead of DEBUG Remove debug_level GUC parameter elog() numbers now start at 10 Add test to print error message if older elog() values are passed to elog() Bootstrap mode now has a -d that requires an argument, like postmaster
* Tweak GiST code to work correctly on machines where 8-byte alignmentTom Lane2002-02-111-14/+28
| | | | | | of pointers is required. Patch from Teodor Sigaev per pghackers discussion. It's an ugly kluge but avoids forcing initdb; we'll put a better fix into 7.3 or later.
* Add more sanity-checking to PageAddItem and PageIndexTupleDelete,Tom Lane2002-01-151-2/+2
| | | | | | | to prevent spreading of corruption when page header pointers are bad. Merge PageZero into PageInit, since it was never used separately, and remove separate memset calls used at most other PageInit call points. Remove IndexPageCleanup, which wasn't used at all.
* New pgindent run with fixes suggested by Tom. Patch manually reviewed,Bruce Momjian2001-11-051-2/+2
| | | | initdb/regression tests pass.
* pgindent run on all C files. Java run to follow. initdb/regressionBruce Momjian2001-10-251-421/+538
| | | | tests pass.
* Rearrange fmgr.c and relcache so that it's possible to keep FmgrInfoTom Lane2001-10-061-22/+22
| | | | | | | | | lookup info in the relcache for index access method support functions. This makes a huge difference for dynamically loaded support functions, and should save a few cycles even for built-in ones. Also tweak dfmgr.c so that load_external_function is called only once, not twice, when doing fmgr_info for a dynamically loaded function. All per performance gripe from Teodor Sigaev, 5-Oct-01.
* Update GiST for new pg_opclass arrangement (finally a clean solutionTom Lane2001-08-221-103/+69
| | | | | | for haskeytype). Update GiST contrib modules too. Add linear-time split algorithm for R-tree GiST opclass. From Oleg Bartunov and Teodor Sigaev.
* Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions inTom Lane2001-08-211-43/+54
| | | | | | | | | | | | | | | | | | | | pgsql-hackers. pg_opclass now has a row for each opclass supported by each index AM, not a row for each opclass name. This allows pg_opclass to show directly whether an AM supports an opclass, and furthermore makes it possible to store additional information about an opclass that might be AM-dependent. pg_opclass and pg_amop now store "lossy" and "haskeytype" information that we previously expected the user to remember to provide in CREATE INDEX commands. Lossiness is no longer an index-level property, but is associated with the use of a particular operator in a particular index opclass. Along the way, IndexSupportInitialize now uses the syscaches to retrieve pg_amop and pg_amproc entries. I find this reduces backend launch time by about ten percent, at the cost of a couple more special cases in catcache.c's IndexScanOK. Initial work by Oleg Bartunov and Teodor Sigaev, further hacking by Tom Lane. initdb forced.
* 1. null-safe interface to GiSTBruce Momjian2001-08-101-322/+424
| | | | | | | | | | | | | | (as proposed in http://fts.postgresql.org/db/mw/msg.html?mid=1028327) 2. support for 'pass-by-value' arguments - to test this we used special opclass for int4 with values in range [0-2^15] More testing will be done after resolving problem with index_formtuple and implementation of B-tree using GiST 3. small patch to contrib modules (seg,cube,rtree_gist,intarray) - mark functions as 'isstrict' where needed. Oleg Bartunov
* Restructure index AM interface for index building and index tuple deletion,Tom Lane2001-07-151-198/+210
| | | | | | | | | | | | | | | | | | | | | | | | | per previous discussion on pghackers. Most of the duplicate code in different AMs' ambuild routines has been moved out to a common routine in index.c; this means that all index types now do the right things about inserting recently-dead tuples, etc. (I also removed support for EXTEND INDEX in the ambuild routines, since that's about to go away anyway, and it cluttered the code a lot.) The retail indextuple deletion routines have been replaced by a "bulk delete" routine in which the indexscan is inside the access method. I haven't pushed this change as far as it should go yet, but it should allow considerable simplification of the internal bookkeeping for deletions. Also, add flag columns to pg_am to eliminate various hardcoded tests on AM OIDs, and remove unused pg_am columns. Fix rtree and gist index types to not attempt to store NULLs; before this, gist usually crashed, while rtree managed not to crash but computed wacko bounding boxes for NULL entries (which might have had something to do with the performance problems we've heard about occasionally). Add AtEOXact routines to hash, rtree, and gist, all of which have static state that needs to be reset after an error. We discovered this need long ago for btree, but missed the other guys. Oh, one more thing: concurrent VACUUM is now the default.
* Nest macros with slightly less enthusiasm, for performance and to avoidTom Lane2001-06-111-3/+5
| | | | having non-gcc compilers spit up.
* Updates to make GIST work with multi-key indexes (from Oleg BartunovTom Lane2001-05-311-229/+674
| | | | | and Teodor Sigaev). Declare key values as Datum where appropriate, rather than char* (Tom Lane).
* Tweak StrategyEvaluation data structure to eliminate hardwired limit onTom Lane2001-05-301-4/+5
| | | | | number of strategies supported by an index AM. Add missing copyright notices and CVS $Header$ markers to GIST source files.
* we found a problem in GiST with massive insert/update operationsBruce Momjian2001-05-151-6/+10
| | | | | | | | | | | with many NULLs ( inserting of NULL into indexed field cause ERROR: MemoryContextAlloc: invalid request size) As a workaround 'vacuum analyze' could be used. This patch resolves the problem, please upply to 7.1.1 sources and current cvs tree. Oleg Bartunov
* Re-add pg_index.indhaskeytype.Bruce Momjian2001-05-151-1/+2
|
* Remove columns pg_index.haskeytype and pg_index.indisclustered. Not used.Bruce Momjian2001-05-141-2/+1
|
* Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane2001-05-071-8/+8
| | | | | | | | | | | | | | | | | a separate statement (though it can still be invoked as part of VACUUM, too). pg_statistic redesigned to be more flexible about what statistics are stored. ANALYZE now collects a list of several of the most common values, not just one, plus a histogram (not just the min and max values). Random sampling is used to make the process reasonably fast even on very large tables. The number of values and histogram bins collected is now user-settable via an ALTER TABLE command. There is more still to do; the new stats are not being used everywhere they could be in the planner. But the remaining changes for this project should be localized, and the behavior is already better than before. A not-very-related change is that sorting now makes use of btree comparison routines if it can find one, rather than invoking '<' twice.
* pgindent run. Make it all clean.Bruce Momjian2001-03-221-319/+379
|
* Repair a number of places that didn't bother to check whether PageAddItemTom Lane2001-03-071-1/+4
| | | | | | | | | | succeeds or not. Revise rtree page split algorithm to take care about making a feasible split --- ie, will the incoming tuple actually fit? Failure to make a feasible split, combined with failure to notice the failure, account for Jim Stone's recent bug report. I suspect that hash and gist indices may have the same type of bug, but at least now we'll get error messages rather than silent failures if so. Also clean up rtree code to use Datum rather than char* where appropriate.
* Clean up index/btree comments/macros, as approved.Bruce Momjian2001-02-221-2/+2
|
* Clean up handling of tuple descriptors so that result-tuple descriptorsTom Lane2001-01-291-2/+2
| | | | | | | | allocated by plan nodes are not leaked at end of query. This doesn't really matter for normal queries, but it sure does for queries invoked repetitively inside SQL functions. Clean up some other grotty code associated with tupdescs, and fix a few other memory leaks exposed by tests with simple SQL functions.