News for hackers. Stuff that matters.
Re:Working around a case where the Postgres planner is “not ... by fabian2k on Monday August 02, 2021 @03:33PM (#28041548)
I don't know the internals here, but I think I can make a plausible guess here. The index-only scan is generally triggered only when every column in your query is contained in the relevant index. In this case the index is a functional index, so it's not only plain columns in there. The function needs the data column, but the functional index already stores the result of the function. To the query planner it looks like the query needs the data column, while it actually doesn't need it.

This is a bit of an uncommon case that would need special handling in the query planner. So it's not that odd that it is not implemented yet, though I would suspect that it'll be added at some point.

There are no comments on this comment yet.