3 ms·
I think the real question here boils down to semantics: 1. Do you really need to have page numbers and if so, when? 2. Do I really need to skip pages or go to
by majkinetor 4y ago
I think the real question here boils down to semantics:
1. Do you really need to have page numbers and if so, when?
2. Do I really need to skip pages or go to arbitrary one and if so, when?
3. Can't I just show you first N rows forever, and demand that you limit results by tweaking your filter? What is the N I would allow this.
4. When do I show the count of items, and when not?
6. Do I need an estimate or precise count?
7. Shouldn't I just infinite scroll up to some N? How does that limit the user, can he skip some pages in that way or what happens when he back and forth from the item details to the results list?
8. How big are those lists? Do they grow forever and if so, is it frequent or not? How many new items you expect per year? Do users always need to use filter or they need a "gimme everything" case? Can we delegate to client some of the pagination?
Depending on answers to those questions (and more), we can determine technology behind. We know that COUNT(*) is expensive and that OFFSET sucks, but we also know that it might not matter at all in some cases (premature optimization) and it might be deal breaker in others.