Re:Working around a case where the Postgres planner is “not ...
by kmdupree on Monday August 02, 2021 @03:36PM
(#28041583)
Thanks for reading!
I hear you on visibility maps being intimidating. In practice, I haven't seen any cases where visibility map issues have prevented an index-only scan. But we did initially think that the visibility map was to blame for what we were seeing!
RE space of the index: it cost us about 1% of the free disk space on our workers. It was worth it for this particular feature.
What surprises me here a bit is that this only provides a factor of two improvement. I would have expected the index to be much smaller than the table, though they include a bunch of columns in the index. At that ratio I'd be a bit worried about consuming a serious amount of space for that speedup, but that's impossible to judge without knowing the details. And if the performance is important enough here of course this is still worth it even if the index is large.