mirror of
https://github.com/postgres/postgres.git
synced 2025-04-25 21:42:33 +03:00
Fix memory leak in GIN index scans.
The code had a query-lifespan memory leak when encountering GIN entries that have posting lists (rather than posting trees, ie, there are a relatively small number of heap tuples containing this index key value). With a suitable data distribution this could add up to a lot of leakage. Problem seems to have been introduced by commit 36a35c550, so back-patch to 9.4. Julien Rouhaud
This commit is contained in:
parent
6f0d6a5078
commit
f0e766bd7f
@ -281,6 +281,7 @@ collectMatchBitmap(GinBtreeData *btree, GinBtreeStack *stack,
|
|||||||
ipd = ginReadTuple(btree->ginstate, scanEntry->attnum, itup, &nipd);
|
ipd = ginReadTuple(btree->ginstate, scanEntry->attnum, itup, &nipd);
|
||||||
tbm_add_tuples(scanEntry->matchBitmap, ipd, nipd, false);
|
tbm_add_tuples(scanEntry->matchBitmap, ipd, nipd, false);
|
||||||
scanEntry->predictNumberResult += GinGetNPosting(itup);
|
scanEntry->predictNumberResult += GinGetNPosting(itup);
|
||||||
|
pfree(ipd);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
Loading…
x
Reference in New Issue
Block a user