API Design · Middle · Question 14 of 75
Why is returning a total count with every page sometimes a problem?
- 1HTTP doesn't allow numbers in responses
- 2Clients never need totals
- ✓Correct answer: Counting matching rows can be expensive on large tables; make it optional, approximate or cached
Explanation
Many UIs only need 'is there a next page?', which cursor pagination answers cheaply.