Skip to content

Research: Splitting Coalesce queries into 2 queries performance testing #6714

Open

Description

@cnlucas

Summary
Our current SeekCoalescePaginator relies on COALESCE, but we do not have functional indexes that make these operations performant. As a result, SA queries are degrading in performance.
This ticket investigates whether splitting these queries into two separate paths — one targeting null values and one targeting non‑null values — provides a significant performance improvement.

What We’re After
Evaluate whether replacing the existing single‑query pattern (sorting via COALESCE) with a two‑query approach can reduce execution time and improve index utilization. Specifically:

Determine whether isolating nulls and non‑nulls allows the underlying indexes to be used correctly.
Benchmark the performance difference between:

The current COALESCE‑based paginator
A split-query strategy (null bucket + non‑null bucket)

Assess feasibility, maintainability, and any downstream risks of adopting the split-query approach.

Related Ticket(s)
[ ] #6662

Action Item(s)

  • Reproduce slow performance and capture baseline metrics (execution time, query plan).
  • Prototype the “split queries” approach:

Query A: records where sortable field IS NULL
Query B: records where sortable field IS NOT NULL

  • Document findings and recommend whether to adopt the new pattern.
  • If beneficial, create follow‑up implementation tickets.

Completion Criteria

  • A clear recommendation (including risks + tradeoffs) is produced.

Activity

  1. self-assigned this
    on Sep 9, 2026
  2. added this to the 32.i milestone on Sep 9, 2026
  3. moved this to 📥 Assigned in Website projecton Sep 14, 2026
  4. modified the milestones: 32.i, 33.1 on Sep 14, 2026
  5. modified the milestones: 33.1, 33.2 on Sep 29, 2026
  6. modified the milestones: 33.2, 33.3 on Oct 9, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions