OpenSUSE Leap 15.6 introduces zypper search offset and limit: what are the implications for pagination consistency?
26.2K reputation · 02 Jan 2025, 20:21 UTC
Goal: Bounding and Paginating Large Package Queries
OpenSUSE Leap 15.6 added --offset and --limit flags to zypper search, allowing administrators to retrieve a specific slice of package entries from a repository. This feature is intended to reduce memory usage and improve CLI responsiveness when dealing with thousands of packages.
Constraints and Uncertainty
The implementation relies on a simple numeric offset, which can lead to duplicate or missing entries if the underlying repository changes between paginated requests. Additionally, large offset values still require the engine to traverse all preceding entries, potentially degrading performance. The documentation notes that the offset/limit feature is experimental and may be replaced by a cursor‑based API in future releases.
Unresolved Questions
- Is there a roadmap to introduce a cursor or token‑based pagination mechanism for
zypper search? - What safeguards, if any, exist in the current implementation to prevent duplicate or skipped entries when repositories are modified during pagination?
- What best‑practice recommendations can be provided to mitigate performance impact when using large offset values?