News for hackers. Stuff that matters.
Re:An unexpected find that freed 20GB of unused index space ... by maweki on Monday February 01, 2021 @11:03AM (#25989812)
That would highly depend on what you select. If the query could be answered by index only, like COUNT(*), it would probably use the index. You are right if you want to query any data from that row that's not in the index.
Re:An unexpected find that freed 20GB of unused index space ... by mnw21cam on Monday February 01, 2021 @11:34AM (#25990173)
I might be out of touch a little with Postgres (I last used it in 2010), but my impression was that COUNT(*) still needed to scan the actual table in order to exclude rows that had been deleted in a transaction, due to the way multi-version concurrency worked. Is this something that has been improved since then?
Re:An unexpected find that freed 20GB of unused index space ... by zeroimpl on Monday February 01, 2021 @12:04PM (#25990495)
They support index-only scans now, so there is some sort of optimization which bypasses the table lookup, at least in certain cases.