- Notifications
You must be signed in to change notification settings - Fork4.9k
Commit8182455
committed
Keep the decompressed filter in brin_bloom_union
The brin_bloom_union() function combines two BRIN summaries, by mergingone filter into the other. With bloom, we have to decompress the filtersfirst, but the function failed to update the summary to store the mergedfilter. As a consequence, the index may be missing some of the data, andreturn false negatives.This issue exists since BRIN bloom indexes were introduced in Postgres14, but at that point the union function was called only when twosessions happened to summarize a range concurrently, which is rare. Itgot much easier to hit in 17, as parallel builds use the union functionto merge summaries built by workers.Fixed by storing a pointer to the decompressed filter, and freeing theoriginal one. Free the second filter too, if it was decompressed. Thefreeing is not strictly necessary, because the union is called inshort-lived contexts, but it's tidy.Backpatch to 14, where BRIN bloom indexes were introduced.Reported by Arseniy Mukhin, investigation and fix by me.Reported-by: Arseniy MukhinDiscussion:https://postgr.es/m/18855-1cf1c8bcc22150e6%40postgresql.orgBackpatch-through: 141 parent5552736 commit8182455
1 file changed
+11
-0
lines changedLines changed: 11 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
692 | 692 |
| |
693 | 693 |
| |
694 | 694 |
| |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
| 699 | + | |
| 700 | + | |
| 701 | + | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
695 | 706 |
| |
696 | 707 |
| |
697 | 708 |
| |
|
0 commit comments
Comments
(0)