summaryrefslogtreecommitdiff
path: root/src/backend/access/gin
Commit message (Collapse)AuthorAgeFilesLines
* Move BufferGetPageSize and BufferGetPage from bufpage.h to bufmgr.h. It isAlvaro Herrera2008-06-081-1/+3
| | | | | | | | | | more logical that way, and also it reduces the amount of unnecessary includes in bufpage.h, which is widely used. Zdenek Kotala. My previous patch to bufpage.h should also have credited him as author, but I forgot (sorry about that).
* Extend GIN to support partial-match searches, and extend tsquery to supportTom Lane2008-05-163-23/+385
| | | | | | prefix matching using this facility. Teodor Sigaev and Oleg Bartunov
* Persuade GIN to react to control-C in a reasonable amount of timeTom Lane2008-05-161-1/+10
| | | | while building a GIN index.
* Put back bufmgr.h in bufpage.h -- it is needed by some macros.Alvaro Herrera2008-05-121-2/+1
| | | | | Remove #include bufmgr.h from (most?) source files which already include bufpage.h.
* Restructure some header files a bit, in particular heapam.h, by removing someAlvaro Herrera2008-05-129-14/+26
| | | | | | | | | | | | unnecessary #include lines in it. Also, move some tuple routine prototypes and macros to htup.h, which allows removal of heapam.h inclusion from some .c files. For this to work, a new header file access/sysattr.h needed to be created, initially containing attribute numbers of system columns, for pg_dump usage. While at it, make contrib ltree, intarray and hstore header files more consistent with our header style.
* Fix using too many LWLocks bug, reported by Craig RingerTeodor Sigaev2008-04-221-205/+157
| | | | | | | | | <craig@postnewspapers.com.au>. It was my mistake, I missed limitation of number of held locks, now GIN doesn't use continiuous locks, but still hold buffers pinned to prevent interference with vacuum's deletion algorithm. Backpatch is needed.
* Push index operator lossiness determination down to GIST/GIN opclassTom Lane2008-04-142-32/+76
| | | | | | | | | | | "consistent" functions, and remove pg_amop.opreqcheck, as per recent discussion. The main immediate benefit of this is that we no longer need 8.3's ugly hack of requiring @@@ rather than @@ to test weight-using tsquery searches on GIN indexes. In future it should be possible to optimize some other queries better than is done now, by detecting at runtime whether the index match is exact or not. Tom Lane, after an idea of Heikki's, and with some help from Teodor.
* Phase 2 of project to make index operator lossiness be determined at runtimeTom Lane2008-04-131-5/+9
| | | | | | | | | | | | instead of plan time. Extend the amgettuple API so that the index AM returns a boolean indicating whether the indexquals need to be rechecked, and make that rechecking happen in nodeIndexscan.c (currently the only place where it's expected to be needed; other callers of index_getnext are just erroring out for now). For the moment, GIN and GIST have stub logic that just always sets the recheck flag to TRUE --- I'm hoping to get Teodor to handle pushing that control down to the opclass consistent() functions. The planner no longer pays any attention to amopreqcheck, and that catalog column will go away in due course.
* Replace "amgetmulti" AM functions with "amgetbitmap", in which the wholeTom Lane2008-04-101-14/+19
| | | | | | | | | | | | | | | | | | indexscan always occurs in one call, and the results are returned in a TIDBitmap instead of a limited-size array of TIDs. This should improve speed a little by reducing AM entry/exit overhead, and it is necessary infrastructure if we are ever to support bitmap indexes. In an only slightly related change, add support for TIDBitmaps to preserve (somewhat lossily) the knowledge that particular TIDs reported by an index need to have their quals rechecked when the heap is visited. This facility is not really used yet; we'll need to extend the forced-recheck feature to plain indexscans before it's useful, and that hasn't been coded yet. The intent is to use it to clean up 8.3's horrid @@@ kluge for text search with weighted queries. There might be other uses in future, but that one alone is sufficient reason. Heikki Linnakangas, with some adjustments by me.
* Make source code READMEs more consistent. Add CVS tags to all README files.Bruce Momjian2008-03-201-0/+2
|
* Refactor backend makefiles to remove lots of duplicate codePeter Eisentraut2008-02-191-8/+2
|
* Update copyrights in source tree to 2008.Bruce Momjian2008-01-0111-22/+22
|
* Improve GIN index build's tracking of memory usage by usingTom Lane2007-11-162-17/+17
| | | | | | | | | GetMemoryChunkSpace, not just the palloc request size. This brings the allocatedMemory counter close enough to reality (as measured by MemoryContextStats printouts) that I think we can get rid of the arbitrary factor-of-2 adjustment that was put into the code initially. Given the sensitivity of GIN build to work memory size, not using as much of work memory as we're allowed to seems a pretty bad idea.
* Re-run pgindent with updated list of typedefs. (Updated README shouldBruce Momjian2007-11-151-3/+3
| | | | avoid this problem in the future.)
* pgindent run for 8.3.Bruce Momjian2007-11-159-86/+91
|
* Clean up some stray references to tsearch2.Tom Lane2007-11-131-1/+1
|
* - Add check of already changed page while replay WAL. This touches onlyTeodor Sigaev2007-10-291-52/+60
| | | | | | | | | | | | | ginRedoInsert(), because other ginRedo* functions rewrite whole page or make changes which could be applied several times without consistent's loss - Remove check of identifying of corresponding split record: it's possible that replaying of WAL starts after actual page split, but before removing of that split from incomplete splits list. In this case, that check cause FATAL error. Per stress test which reproduces bug reported by Craig McElroy <craig.mcelroy@contegix.com>
* Fix coredump during replay WAL after crash. Change entrySplitPage() to preventTeodor Sigaev2007-10-291-18/+30
| | | | | | | | usage of any information from system catalog, because it could be called during replay of WAL. Per bug report from Craig McElroy <craig.mcelroy@contegix.com>. Patch doesn't change on-disk storage.
* HOT updates. When we update a tuple without changing any of its indexedTom Lane2007-09-203-12/+12
| | | | | | | | | | | | columns, and the new version can be stored on the same heap page, we no longer generate extra index entries for the new version. Instead, index searches follow the HOT-chain links to ensure they find the correct tuple version. In addition, this patch introduces the ability to "prune" dead tuples on a per-page basis, without having to do a complete VACUUM pass to recover space. VACUUM is still needed to clean up dead index entries, however. Pavan Deolasee, with help from a bunch of other people.
* Remove GIN interface section, which is now documented in SGML.Bruce Momjian2007-09-141-29/+0
| | | | Heikki Linnakangas
* Redefine the lp_flags field of item pointers as having four states, ratherTom Lane2007-09-123-12/+12
| | | | | | | | | than two independent bits (one of which was never used in heap pages anyway, or at least hadn't been in a very long time). This gives us flexibility to add the HOT notions of redirected and dead item pointers without requiring anything so klugy as magic values of lp_off and lp_len. The state values are chosen so that for the states currently in use (pre-HOT) there is no change in the physical representation.
* Tsearch2 functionality migrates to core. The bulk of this work is byTom Lane2007-08-211-2/+11
| | | | | | | | Oleg Bartunov and Teodor Sigaev, but I did a lot of editorializing, so anything that's broken is probably my fault. Documentation is nonexistent as yet, but let's land the patch so we can get some portability testing done.
* Move call of MarkBufferDirty() before XLogInsert() as required.Teodor Sigaev2007-06-053-18/+25
| | | | | Many thanks to Heikki Linnakangas <heikki@enterprisedb.com> for his sharp eyes.
* Fix bundle bugs of GIN:Teodor Sigaev2007-06-045-54/+146
| | | | | | | | | | | | | | | | | - Fix possible deadlock between UPDATE and VACUUM queries. Bug never was observed in 8.2, but it still exist there. HEAD is more sensitive to bug after recent "ring" of buffer improvements. - Fix WAL creation: if parent page is stored as is after split then incomplete split isn't removed during replay. This happens rather rare, only on large tables with a lot of updates/inserts. - Fix WAL replay: there was wrong test of XLR_BKP_BLOCK_* for left page after deletion of page. That causes wrong rightlink field: it pointed to deleted page. - add checking of match of clearing incomplete split - cleanup incomplete split list after proceeding All of this chages doesn't change on-disk storage, so backpatch... But second point may be an issue for replaying logs from previous version.
* Replace ReadBuffer to ReadBufferWithStrategy in all vacuum-involved placesTeodor Sigaev2007-05-311-11/+14
| | | | to implement limited-size "ring" of buffers for VACUUM for GIN & GIST
* Fix up pgstats counting of live and dead tuples to recognize that committedTom Lane2007-05-271-2/+2
| | | | | | | | | | | and aborted transactions have different effects; also teach it not to assume that prepared transactions are always committed. Along the way, simplify the pgstats API by tying counting directly to Relations; I cannot detect any redeeming social value in having stats pointers in HeapScanDesc and IndexScanDesc structures. And fix a few corner cases in which counts might be missed because the relation's pgstat_info pointer hadn't been set.
* Fix a few typos in comments in GiN.Neil Conway2007-02-015-10/+10
|
* Allow GIN's extractQuery method to signal that nothing can satisfy the query.Teodor Sigaev2007-01-316-17/+50
| | | | | | | | | | | | | In this case extractQuery should returns -1 as nentries. This changes prototype of extractQuery method to use int32* instead of uint32* for nentries argument. Based on that gincostestimate may see two corner cases: nothing will be found or seqscan should be used. Per proposal at http://archives.postgresql.org/pgsql-hackers/2007-01/msg01581.php PS tsearch_core patch should be sightly modified to support changes, but I'm waiting a verdict about reviewing of tsearch_core patch.
* Remove remains of old depend target.Peter Eisentraut2007-01-201-8/+1
|
* Update CVS HEAD for 2007 copyright. Back branches are typically notBruce Momjian2007-01-0511-22/+22
| | | | back-stamped for this.
* Fix some small typos in comments. Greg StarkTom Lane2007-01-041-3/+3
|
* Fix bug with page deletion. If inner page is removed and it tries toTeodor Sigaev2006-11-301-7/+15
| | | | | | | | | | remove page on next level linked from next inner page, ginScanToDelete() wrongly sets parent page. Bug reveals when many item pointers from index was deleted ( several hundred thousands). Bug is discovered by hubert depesz lubaczewski <depesz@gmail.com> Suppose, we need rc2 before release...
* Fix some typos in comments.Neil Conway2006-11-125-27/+27
|
* Message style improvementsPeter Eisentraut2006-10-062-4/+4
|
* Make use of qsort_arg in several places that were formerly using klugyTom Lane2006-10-051-37/+25
| | | | | | static variables. This avoids any risk of potential non-reentrancy, and in particular offers a much cleaner workaround for the Intel compiler bug that was affecting ginutil.c.
* pgindent run for 8.2.Bruce Momjian2006-10-0411-1592/+2091
|
* Fix free space map to correctly track the total amount of FSM space neededTom Lane2006-09-211-6/+8
| | | | | | | 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.
* Improve error message. Per discussionTeodor Sigaev2006-09-141-2/+9
| | | | http://archives.postgresql.org/pgsql-general/2006-09/msg00186.php
* If we're going to advertise the array overlap/containment operators,Tom Lane2006-09-101-175/+13
| | | | | | we probably should make them work reliably for all arrays. Fix code to handle NULLs and multidimensional arrays, move it into arrayfuncs.c. GIN is still restricted to indexing arrays with no null elements, however.
* Rename contains/contained-by operators to @> and <@, per discussion thatTom Lane2006-09-101-3/+3
| | | | | | | | 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.
* Fix Intel compiler bug. Per discussionTeodor Sigaev2006-09-051-2/+17
| | | | | 'GIN FailedAssertions on Itanium2 with Intel compiler' in pgsql-hackers, http://archives.postgresql.org/pgsql-hackers/2006-08/msg01914.php
* Fix BUG #2594: Gin Indexes cause server to crash when it builds on empty tableTeodor Sigaev2006-08-291-1/+4
|
* Make recovery from WAL be restartable, by executing a checkpoint-likeTom Lane2006-08-071-2/+10
| | | | | | | | | | 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.
* Add missing pgstat_count_index_scan(), per Andreas Seltenreich.Tom Lane2006-08-031-1/+4
|
* Change the relation_open protocol so that we obtain lock on a relationTom Lane2006-07-311-8/+9
| | | | | | | | | | | | (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.
* Fix getDatumCopy(): don't use store_att_byval to copy into a DatumTom Lane2006-07-161-25/+22
| | | | | | variable (this accounts for regression failures on PPC64, and in fact won't work on any big-endian machine). Get rid of hardwired knowledge about datum size rules; make it look just like datumCopy().
* Improve error message wording.Tom Lane2006-07-161-2/+2
|
* Remove 576 references of include files that were not needed.Bruce Momjian2006-07-1411-57/+11
|
* Tweak fillfactor code as per my recent proposal. Fix nbtsort.c so thatTom Lane2006-07-111-2/+2
| | | | | | it can handle small fillfactors for ordinary-sized index entries without failing on large ones; fix nbtinsert.c to distinguish leaf and nonleaf pages; change the minimum fillfactor to 10% for all index types.
* Add support to GIN for =(anyarray,anyarray) operationTeodor Sigaev2006-07-111-1/+3
|