Re:Pagination 101
by Pharaoh2 on Tuesday February 02, 2016 @03:56AM
(#11018341)
Count on an indexed column is a pretty fast operation and it's always correct.
[ Parent
| on HN ]
Re:Pagination 101
by calpaterson on Tuesday February 02, 2016 @07:48AM
(#11019098)
count(*) is a linear time operation (roughly to the size of the table) on postgres. It does an index-only scan but with a sufficiently large table/index it's still a problem. It's to do with postgres MVCC implementation. I don't know if other SQL databases have this problem. MySQL doesn't seem to.