Cursor Pagination
カーソルページネーション
カーソルページネーションは、固定の並び順で非表示マーカーの後も続きます。前のレコードをすべて数えてスキップすることはありません。
もう一つの例
レビュキューはケースを`created_at DESC, id DESC`でソートし、両方の値を隠す`endCursor`を返します。上の新しいケースは、すでにレビューされた行を繰り返しません。カーソルのレコードが削除されても、次のページはソート境界から始まり、変更されたカーソルは検証に失敗します。
主な部分
- 01決定的な一意の順序
- 02不透明継続カーソル
- 03有界エッジページ
以下の場合に使用します
安定した前後ページがページ番号より重要な、大規模または急速に変化するソート済みデータに使用します。
以下の場合は使用しないでください
変更されるデータベースのオフセットを隠してカーソルと呼んではいけない。別個のインデックス計画なしに任意のページへのジャンプを約束してはいけない。
コードで使用する名前
opaque cursor over a unique deterministic sort key + first/after or last/before 出荷前に
Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback.
Outcome:Complete the task with カーソルページネーション (Cursor Pagination)。 User context:レビュキューはケースを`created_at DESC, id DESC`でソートし、両方の値を隠す`endCursor`を返します。上の新しいケースは、すでにレビューされた行を繰り返しません。カーソルのレコードが削除されても、次のページはソート境界から始まり、変更されたカーソルは検証に失敗します。 Technical concept or control:カーソルページネーション (Cursor Pagination)。 Why it fits:安定した前後ページがページ番号より重要な、大規模または急速に変化するソート済みデータに使用します。 Do not use it when:変更されるデータベースのオフセットを隠してカーソルと呼んではいけない。別個のインデックス計画なしに任意のページへのジャンプを約束してはいけない。 Engineering requirements: Define inputs, outputs, contracts, and rules that must always hold. Set authorization and input checks. Define failures, timeouts, retries, one-time effects, data moves, and compatibility limits. Operations: Add useful signals and logs that hide sensitive data. Set capacity limits and write an operator guide. Test recovery and rollback. Acceptance criteria: Contract and failure-path tests pass. Data and authorization rules still hold during retries and partial failures. Check performance limits, monitoring, recovery, and rollback. Evidence and limits (evidence boundary):単一の公式標準が全体の用語を管理するわけではありません。その意味はチーム、プラットフォーム、またはフレームワークによって変わる可能性があります。 Unknowns to confirm: Where the code runs, data stores, traffic shape, consistency needs, and the security boundary. Also confirm the compatibility period, service goals, and rollback limits.
このリクエストを確認する
Review how カーソルページネーション (Cursor Pagination) is used now. Definition: カーソルページネーションは、固定の並び順で非表示マーカーの後も続きます。前のレコードをすべて数えてスキップすることはありません。 Release checks: Check contracts and invariants, authorization, and input limits. Test retries, one-time effects, timeouts, and partial failures. Verify data integrity, compatibility, monitoring, recovery, and rollback. Before changing code, list the evidence, gaps, severity, and the smallest safe fix.