Concurrency for GiST
Teodor Sigaev <teodor@sigaev.ru>
Concurrency for GiST
- 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
Files
| Path | Change | +/− |
|---|---|---|
| src/backend/access/gist/gist.c | modified | +384 −99 |
| src/backend/access/gist/gistget.c | modified | +204 −122 |
| src/backend/access/gist/gistscan.c | modified | +33 −70 |
| src/backend/access/gist/gistutil.c | modified | +30 −18 |
| src/backend/access/gist/gistvacuum.c | modified | +150 −116 |
| src/backend/access/gist/gistxlog.c | modified | +42 −59 |
| src/backend/access/index/indexam.c | modified | +8 −2 |
| src/include/access/gist.h | modified | +28 −11 |
| src/include/access/gist_private.h | modified | +101 −88 |
| src/include/access/gistscan.h | modified | +3 −2 |
| src/include/catalog/catversion.h | modified | +2 −2 |
| src/include/catalog/pg_am.h | modified | +2 −2 |