4 ms·
Also lots of cubes can do similar things. Seems the author made a lot of assumptions without a lot of research. For one example, I would strongly doubt that c
by wredue 3y ago
Also lots of cubes can do similar things.
Seems the author made a lot of assumptions without a lot of research.
For one example, I would strongly doubt that count(*) without a where clause isn’t already highly optimized.
- EmilStenstrom 3y agoThe author did lots of research. Here's a comparison of some common other ways to do this: https://docs.epsio.io/faq/ https://docs.epsio.io/faq/
- phamilton 3y ago> I would strongly doubt that count() without a where clause isn’t already highly optimized It's actually not well optimized in PostgreSQL because of MVCC. See https://wiki.postgresql.org/wiki/Slow_Counting https://wiki.postgresql.org/wiki/Slow_Counting TL;DR: The fact that multiple transactions can see different states of the data means that there can be no straightforward way for "COUNT(*)" to summarize data across the whole table. PostgreSQL must walk through all rows to determine visibility.