aboutsummaryrefslogtreecommitdiff
path: root/src/backend/access/gist/gist.c
Commit message (Collapse)AuthorAge
...
* Restructure pg_opclass, pg_amop, and pg_amproc per previous discussions inTom Lane2001-08-21
| | | | | | | | | | | | | | | | | | | | 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-10
| | | | | | | | | | | | | | (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-15
| | | | | | | | | | | | | | | | | | | | | | | | | 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-11
| | | | having non-gcc compilers spit up.
* Updates to make GIST work with multi-key indexes (from Oleg BartunovTom Lane2001-05-31
| | | | | 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-30
| | | | | 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-15
| | | | | | | | | | | 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-15
|
* Remove columns pg_index.haskeytype and pg_index.indisclustered. Not used.Bruce Momjian2001-05-14
|
* Rewrite of planner statistics-gathering code. ANALYZE is now available asTom Lane2001-05-07
| | | | | | | | | | | | | | | | | 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-22
|
* Repair a number of places that didn't bother to check whether PageAddItemTom Lane2001-03-07
| | | | | | | | | | 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-22
|
* Clean up handling of tuple descriptors so that result-tuple descriptorsTom Lane2001-01-29
| | | | | | | | 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.
* New feature:Marc G. Fournier2001-01-12
| | | | | | | | | | | | | | | | | | | | | | 1. Support of variable size keys - new algorithm of insertion to tree (GLI - gist layrered insertion). Previous algorithm was implemented as described in paper by Joseph M. Hellerstein et.al "Generalized Search Trees for Database Systems". This (old) algorithm was not suitable for variable size keys and could be not effective ( walking up-down ) in case of multiple levels split Bug fixed: 1. fixed bug in gistPageAddItem - key values were written to disk uncompressed. This caused failure if decompression function does real job. 2. NULLs handling - we keep NULLs in tree. Right way is to remove them, but we don't know how to inform vacuum about index statistics. This is just cosmetic warning message (like in case with R-Tree), but I'm not sure how to recognize real problem if we remove NULLs and suppress this warning as Tom suggested. 3. various memory leaks This work was done by Teodor Sigaev (teodor@stack.net) and Oleg Bartunov (oleg@sai.msu.su).
* No more #ifdef XLOG.Vadim B. Mikheev2000-11-30
|
* Put external declarations into header files.Peter Eisentraut2000-11-21
|
* Change SearchSysCache coding conventions so that a reference count isTom Lane2000-11-16
| | | | | | | maintained for each cache entry. A cache entry will not be freed until the matching ReleaseSysCache call has been executed. This eliminates worries about cache entries getting dropped while still in use. See my posting to pg-hackers of even date for more info.
* Make DROP TABLE rollback-able: postpone physical file delete until commit.Tom Lane2000-11-08
| | | | | | | | | (WAL logging for this is not done yet, however.) Clean up a number of really crufty things that are no longer needed now that DROP behaves nicely. Make temp table mapper do the right things when drop or rename affecting a temp table is rolled back. Also, remove "relation modified while in use" error check, in favor of locking tables at first reference and holding that lock throughout the statement.
* WALVadim B. Mikheev2000-10-21
|
* Cleanup of code for creating index entries. Functional indexes withTom Lane2000-07-14
| | | | | | | | | | | | | pass-by-ref data types --- eg, an index on lower(textfield) --- no longer leak memory during index creation or update. Clean up a lot of redundant code ... did you know that copy, vacuum, truncate, reindex, extend index, and bootstrap each basically duplicated the main executor's logic for extracting information about an index and preparing index entries? Functional indexes should be a little faster now too, due to removal of repeated function lookups. CREATE INDEX 'opt_type' clause is deimplemented by these changes, but I haven't removed it from the parser yet (need to merge with Thomas' latest change set first).
* First stage of reclaiming memory in executor by resetting short-termTom Lane2000-07-12
| | | | | | memory contexts. Currently, only leaks in expressions executed as quals or projections are handled. Clean up some old dead cruft in executor while at it --- unused fields in state nodes, that sort of thing.
* TOASTJan Wieck2000-07-03
| | | | | | | | WARNING: This is actually broken - we have self-deadlocks due to concurrent changes in buffer management. Vadim and me are working on it. Jan
* Get rid of IndexIsUniqueNoCache() kluge by the simple expedient ofTom Lane2000-06-17
| | | | | | | passing the index-is-unique flag to index build routines (duh! ... why wasn't it done this way to begin with?). Aside from eliminating an eyesore, this should save a few milliseconds in btree index creation because a full scan of pg_index is not needed any more.
* Clean up #include's.Bruce Momjian2000-06-15
|
* I had overlooked the fact that some fmgr-callable functions return voidTom Lane2000-06-14
| | | | | | --- ie, they're only called for side-effects. Add a PG_RETURN_VOID() macro and use it where appropriate. This probably doesn't change the machine code by a single bit ... it's just for documentation.
* Another batch of fmgr updates. I think I have gotten all old-styleTom Lane2000-06-13
| | | | | functions that take pass-by-value datatypes. Should be ready for port testing ...
* Third round of fmgr updates: eliminate calls using fmgr() andTom Lane2000-05-30
| | | | | fmgr_faddr() in favor of new-style calls. Lots of cleanup of sloppy casts to use XXXGetDatum and DatumGetXXX ...
* Remove unused include files. Do not touch /port or includes used by defines.Bruce Momjian2000-05-30
|
* Ye-old pgindent run. Same 4-space tabs.Bruce Momjian2000-04-12
|
* Fix a bunch of minor portability problems and maybe-bugs revealed byTom Lane2000-03-17
| | | | | | running gcc and HP's cc with warnings cranked way up. Signed vs unsigned comparisons, routines declared static and then defined not-static, that kind of thing. Tedious, but perhaps useful...
* Change reindex command to work properly with gist/hash/rtreeHiroshi Inoue2000-03-01
|
* Fix handling of NULL constraint conditions: per SQL92 spec, a NULL resultTom Lane2000-01-19
| | | | | | | | | from a constraint condition does not violate the constraint (cf. discussion on pghackers 12/9/99). Implemented by adding a parameter to ExecQual, specifying whether to return TRUE or FALSE when the qual result is really NULL in three-valued boolean logic. Currently, ExecRelCheck is the only caller that asks for TRUE, but if we find any other places that have the wrong response to NULL, it'll be easy to fix them.
* setheapoverride() is history. Uses replaced with CommandCounterIncrement()Tom Lane2000-01-17
| | | | | where necessary --- several of them didn't really need it, though. tqual-checking macros simplified accordingly.
* Rename several destroy* functions/tags to drop*.Bruce Momjian1999-12-10
|
* New NameStr macro to convert Name to Str. No need for var.data anymore.Bruce Momjian1999-11-07
| | | | | | Fewer calls to nameout. Better use of RelationGetRelationName.
* Several changes here, not very related but touching some of the same files.Tom Lane1999-09-24
| | | | | | | | | | | | | | | | | | | | | * Buffer refcount cleanup (per my "progress report" to pghackers, 9/22). * Add links to backend PROC structs to sinval's array of per-backend info, and use these links for routines that need to check the state of all backends (rather than the slow, complicated search of the ShmemIndex hashtable that was used before). Add databaseOID to PROC structs. * Use this to implement an interlock that prevents DESTROY DATABASE of a database containing running backends. (It's a little tricky to prevent a concurrently-starting backend from getting in there, since the new backend is not able to lock anything at the time it tries to look up its database in pg_database. My solution is to recheck that the DB is OK at the end of InitPostgres. It may not be a 100% solution, but it's a lot better than no interlock at all...) * In ALTER TABLE RENAME, flush buffers for the relation before doing the rename of the physical files, to ensure we don't get failures later from mdblindwrt(). * Update TRUNCATE patch so that it actually compiles against current sources :-(. You should do "make clean all" after pulling these changes.
* Mega-commit to make heap_open/heap_openr/heap_close take anTom Lane1999-09-18
| | | | | | | | | | | | | | | | | additional argument specifying the kind of lock to acquire/release (or 'NoLock' to do no lock processing). Ensure that all relations are locked with some appropriate lock level before being examined --- this ensures that relevant shared-inval messages have been processed and should prevent problems caused by concurrent VACUUM. Fix several bugs having to do with mismatched increment/decrement of relation ref count and mismatched heap_open/close (which amounts to the same thing). A bogus ref count on a relation doesn't matter much *unless* a SI Inval message happens to arrive at the wrong time, which is probably why we got away with this sloppiness for so long. Repair missing grab of AccessExclusiveLock in DROP TABLE, ALTER/RENAME TABLE, etc, as noted by Hiroshi. Recommend 'make clean all' after pulling this update; I modified the Relation struct layout slightly. Will post further discussion to pghackers list shortly.
* Clean up gcc warning about unused static decl.Tom Lane1999-07-19
|
* Move some system includes into c.h, and remove duplicates.Bruce Momjian1999-07-17
|
* Final cleanup.Bruce Momjian1999-07-16
|
* Change #include's to use <> and "" as appropriate.Bruce Momjian1999-07-15
|
* Remove unused #includes in *.c files.Bruce Momjian1999-07-15
|
* Clean up #include in /include directory. Add scripts for checking includes.Bruce Momjian1999-07-15
|
* pgindent run over code.Bruce Momjian1999-05-25
|
* Change error messages to oids come out as %u and not %d. Change has noBruce Momjian1999-05-10
| | | | real affect now.
* Change my-function-name-- to my_function_name, and optimizer renames.Bruce Momjian1999-02-13
|
* Initial MVCC code.Vadim B. Mikheev1998-12-15
| | | | New code for locking buffer' context.
* Initial attempt to clean up the code...Marc G. Fournier1998-12-14
| | | | | | Switch sprintf() to snprintf() Remove any/all #if 0 -or- #ifdef NOT_USED -or- #ifdef FALSE sections of code
* New HeapTuple structure/interface.Vadim B. Mikheev1998-11-27
|