The article seems to have changed since I commented.
Why don't he use GROUP BY on indexed columns was my first thought also.
I guess we just have to patiently wait for the OP to hopefully read Postgres documentation from postgreSQL 10.x before correcting the article again.
https://web.archive.org/web/20260814160231/https://www.dbos....
It had the same stuff a month ago.