mirror of
https://github.com/postgres/postgres.git
synced 2025-08-19 23:22:23 +03:00
Revise the TIDBitmap API to support multiple concurrent iterations over a
bitmap. This is extracted from Greg Stark's posix_fadvise patch; it seems worth committing separately, since it's potentially useful independently of posix_fadvise.
This commit is contained in:
@@ -8,7 +8,7 @@
|
||||
* Portions Copyright (c) 1994, Regents of the University of California
|
||||
*
|
||||
* IDENTIFICATION
|
||||
* $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.20 2009/01/01 17:23:34 momjian Exp $
|
||||
* $PostgreSQL: pgsql/src/backend/access/gin/ginscan.c,v 1.21 2009/01/10 21:08:36 tgl Exp $
|
||||
*-------------------------------------------------------------------------
|
||||
*/
|
||||
|
||||
@@ -61,6 +61,8 @@ fillScanKey(GinState *ginstate, GinScanKey key, OffsetNumber attnum, Datum query
|
||||
key->scanEntry[i].offset = InvalidOffsetNumber;
|
||||
key->scanEntry[i].buffer = InvalidBuffer;
|
||||
key->scanEntry[i].partialMatch = NULL;
|
||||
key->scanEntry[i].partialMatchIterator = NULL;
|
||||
key->scanEntry[i].partialMatchResult = NULL;
|
||||
key->scanEntry[i].strategy = strategy;
|
||||
key->scanEntry[i].list = NULL;
|
||||
key->scanEntry[i].nlist = 0;
|
||||
@@ -107,6 +109,7 @@ resetScanKeys(GinScanKey keys, uint32 nkeys)
|
||||
key->scanEntry[j].list = NULL;
|
||||
key->scanEntry[j].nlist = 0;
|
||||
key->scanEntry[j].partialMatch = NULL;
|
||||
key->scanEntry[j].partialMatchIterator = NULL;
|
||||
key->scanEntry[j].partialMatchResult = NULL;
|
||||
}
|
||||
}
|
||||
@@ -132,6 +135,8 @@ freeScanKeys(GinScanKey keys, uint32 nkeys)
|
||||
ReleaseBuffer(key->scanEntry[j].buffer);
|
||||
if (key->scanEntry[j].list)
|
||||
pfree(key->scanEntry[j].list);
|
||||
if (key->scanEntry[j].partialMatchIterator)
|
||||
tbm_end_iterate(key->scanEntry[j].partialMatchIterator);
|
||||
if (key->scanEntry[j].partialMatch)
|
||||
tbm_free(key->scanEntry[j].partialMatch);
|
||||
}
|
||||
|
Reference in New Issue
Block a user