"Heap Blocks: " Number meaning on Query Plan for a bitmap heap + index scan What does the number next to Heap Blocks represent in the query plan? I'm not sure if it means the # of blocks (8kb per) of data located on disk representing your data, or in some way the bitmap, which correlates more closely to idea of exact/lossy.
I initially thought it was the former, but I saw in this video (https://youtu.be/UXKYAZOWDgk?t=753) that even with 4mb of work_mem, he could still hold ~2800 heap blocks, which would amount to like 22mb, correct?
4MB was enough to hold references to 2964 heap blocks (plus sub-references to 3531 tuples falling within those blocks).  It doesn't hold the blocks themselves.  The blocks themselves would be held in shared_buffers (Or cycled through shared_buffers if it were insufficient to hold them all), not in work_mem.