API: Keyset Pagination
Our first attempt at keyset pagination can be found https://gitlab.com/gitlab-org/gitlab-foss/issues/45756. It was deployed behind a feature flag and closed. A follow up issue to analyze the response times is still open: https://gitlab.com/gitlab-org/gitlab/issues/22551 The data from the follow up issue indicated that more work was needed to make the keyset pagination usable. The goals differ slightly from the original issue: 1. Support keyset pagination in addition to normal pagination 1. When called with less than a pre-defined offset use normal pagination (e.g. 100 pages - see https://gitlab.com/gitlab-org/gitlab/issues/22551#note_215161789) 1. Keyset pagination is called instead of normal pagination when the offset exceeds the pre-defined offset Steps: - [x] Gather metrics to help decide on deprecation strategy and impact of breaking changes https://gitlab.com/gitlab-org/gitlab/issues/34011 * Can we determine when performance starts to degrade? * Based on the data is there a natural inflection point we should use to start using keyset pagination * **DECISION**: We are going to limit offset pagination to 10,000 records maximum (https://gitlab.com/gitlab-org/gitlab/issues/34011#note_234243031). - [x] Implement `id` based keyset pagination https://gitlab.com/gitlab-org/gitlab/issues/32186 - [ ] Deprecated offset based pagination with high offsets (tbd) * [ ] Disallow offset based pagination with high offsets (tbd) ### Background info: A great blog post and presentation about keyset pagination can be found here: https://use-the-index-luke.com/no-offset.
epic