> However, PostgreSQL's planner is currently not very smart about such cases.
(From https://www.postgresql.org/docs/10/indexes-index-only-scans....)
I suspect this is just a rough edge. Many types of functions may not be consistent, and therefore would need to be re-executed on the original data. Perhaps some of the planner functionality here predates function notation like `IMMUTABLE`.
> However, PostgreSQL's planner is currently not very smart about such cases.
(From https://www.postgresql.org/docs/10/indexes-index-only-scans....)
I suspect this is just a rough edge. Many types of functions may not be consistent, and therefore would need to be re-executed on the original data. Perhaps some of the planner functionality here predates function notation like `IMMUTABLE`.