]> granicus.if.org Git - postgresql/commit
Fix performance problem when building a lossy tidbitmap.
authorTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Aug 2011 18:51:02 +0000 (14:51 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Sat, 20 Aug 2011 18:51:25 +0000 (14:51 -0400)
commit548d1f752be7a11e240f1eadd4f9987a7b9793c5
tree8fec6fe8794014b6cc2bc9441b6ac5d281483fca
parent1ffcc377f692fb227ebfeb6036aa949099d71979
Fix performance problem when building a lossy tidbitmap.

As pointed out by Sergey Koposov, repeated invocations of tbm_lossify can
make building a large tidbitmap into an O(N^2) operation.  To fix, make
sure we remove more than the minimum amount of information per call, and
add a fallback path to behave sanely if we're unable to fit the bitmap
within the requested amount of memory.

This has been wrong since the tidbitmap code was written, so back-patch
to all supported branches.
src/backend/nodes/tidbitmap.c