pgbitmap icon indicating copy to clipboard operation
pgbitmap copied to clipboard

Memory issue when using bitmap_intersection

Open markedmondson opened this issue 4 years ago • 0 comments

I have a table with an array of integers and I want to run a comparison to extract any rows that include a subset of integers.

SELECT bitmap_intersection(to_bitmap('{1, 2, 3}'), to_bitmap(ids)) FROM table; => Query 1 ERROR: ERROR: invalid memory alloc request size 18446744073709551576

Just casting the ids to_bitmap is fine so I'm guessing it's something in the intersection function. What I'm actually looking to get out, however, is a boolean, the same as && provides me. I don't care what the intersection is so presumably there's some sort of performance improvement that could be achieved by providing that functionality and not returning the actual intersection?

Thanks!

markedmondson avatar Dec 08 '21 00:12 markedmondson