Skip to content

feat: pagination using offset-id#278

Merged
cheb0 merged 10 commits intomainfrom
262-id-offset-pagination
Feb 6, 2026
Merged

feat: pagination using offset-id#278
cheb0 merged 10 commits intomainfrom
262-id-offset-pagination

Conversation

@cheb0
Copy link
Member

@cheb0 cheb0 commented Nov 25, 2025

Description

A new way to paginate through logs which is similar to Elasticsearch search_after feature. A user can take doc ID from the last doc on the page and use it as offset for the next page. The field is called offset-id: the first part offset outlines that it provides offset feature, the part id points that it's a doc ID.

Measurements

Our benchmarks

seq-db-paging.js

   http_req_duration..............: avg=1.98ms   min=786.02µs med=1.8ms    max=6.08ms   p(90)=2.87ms   p(95)=3.58ms
      { expected_response:true }...: avg=1.98ms   min=786.02µs med=1.8ms    max=6.08ms   p(90)=2.87ms   p(95)=3.58ms
   http_req_duration..............: avg=2.01ms   min=688.64µs med=1.83ms   max=9.66ms   p(90)=2.92ms   p(95)=3.28ms
      { expected_response:true }...: avg=2.01ms   min=688.64µs med=1.83ms   max=9.66ms   p(90)=2.92ms   p(95)=3.28ms

seq-db-offset-id.js (new)

    http_req_duration..............: avg=1.33ms   min=569.57µs med=1.17ms   max=4.46ms   p(90)=2.07ms  p(95)=2.61ms
      { expected_response:true }...: avg=1.33ms   min=569.57µs med=1.17ms   max=4.46ms   p(90)=2.07ms  p(95)=2.61ms
    http_req_duration..............: avg=1.29ms   min=604.71µs med=1.13ms   max=4.18ms   p(90)=1.98ms   p(95)=2.37ms
      { expected_response:true }...: avg=1.29ms   min=604.71µs med=1.13ms   max=4.18ms   p(90)=1.98ms   p(95)=2.37ms

Elasticsearch

Currently, it's unable to cope with 20 concurrent readers (all CPU is used) but even with a single reader it's slow. Will investigate later.

   http_req_duration..............: avg=4.19s min=1.35ms med=3.86s max=8.27s p(90)=4.25s p(95)=7.6s
      { expected_response:true }...: avg=4.19s min=1.35ms med=3.86s max=8.27s p(90)=4.25s p(95)=7.6s
   http_req_duration..............: avg=4.18s min=1.05ms med=4.06s max=8.22s p(90)=4.23s p(95)=4.8s
      { expected_response:true }...: avg=4.18s min=1.05ms med=4.06s max=8.22s p(90)=4.23s p(95)=4.8s

Results for other data

k8s_pod:payment-backend-* AND level:4, scroll 50 pages 100 logs each (cold run after seq-db restart)
2114 ms (offset) vs 1729 ms (offset-id)
k8s_pod:payment-backend-1 AND level:2, scroll 50 pages 100 logs each (cold run after seq-db restart)
468 ms (offset) vs 166 ms (offset-id)

Fixes #262


  • I have read and followed all requirements in CONTRIBUTING.md;
  • I used LLM/AI assistance to make this pull request;

If you have used LLM/AI assistance please provide model name and full prompt:

Model: {{model-name}}
Prompt: {{prompt}}

@cheb0 cheb0 changed the title feat: new way to paginate using offset-id feat: pagination using offset-id Nov 25, 2025
@codecov-commenter
Copy link

codecov-commenter commented Nov 25, 2025

Codecov Report

❌ Patch coverage is 79.62963% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 71.65%. Comparing base (77fae2c) to head (9d0e557).

Files with missing lines Patch % Lines
seq/seq.go 57.14% 4 Missing and 2 partials ⚠️
storeapi/grpc_search.go 84.21% 2 Missing and 1 partial ⚠️
proxyapi/grpc_v1.go 50.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #278      +/-   ##
==========================================
+ Coverage   71.59%   71.65%   +0.06%     
==========================================
  Files         204      204              
  Lines       14770    14820      +50     
==========================================
+ Hits        10575    10620      +45     
- Misses       3441     3443       +2     
- Partials      754      757       +3     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

# Conflicts:
#	proxy/search/search_request.go
#	storeapi/grpc_search.go
@eguguchkin eguguchkin modified the milestones: v0.65.0, v0.66.0 Jan 19, 2026
@eguguchkin eguguchkin removed their request for review January 30, 2026 10:16
@github-actions
Copy link
Contributor

github-actions bot commented Feb 6, 2026

🔴 Performance Degradation

Some benchmarks have degraded compared to the previous run.
Click on Show table button to see full list of degraded benchmarks.

Show table
Name Previous Current Ratio Verdict
FindSequence_Random/large-4 77fae2 347872
13987.92 MB/s 11435.61 MB/s 0.82 🔴
1171.00 ns/op 1433.00 ns/op 1.22 🔴
FindSequence_Random/small-4 77fae2 347872
5061.19 MB/s 3648.53 MB/s 0.72 🔴
50.58 ns/op 70.17 ns/op 1.39 🔴
FindSequence_Random/tiny-4 77fae2 347872
2850.02 MB/s 2438.65 MB/s 0.86 🔴
22.46 ns/op 26.24 ns/op 1.17 🔴
GenerateDocs-4 77fae2 347872
949.50 ns/op 1103.00 ns/op 1.16 🔴

@cheb0 cheb0 merged commit f8f35dd into main Feb 6, 2026
8 checks passed
@cheb0 cheb0 deleted the 262-id-offset-pagination branch February 6, 2026 05:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add a new parameter (ID offset) for efficient pagination

5 participants