Skip to content

Commit f61a61f

Browse files
committed
perf(custody-probes): order by partition key for ClickHouse early cutoff
Order int_custody_probe_order_by_slot queries by slot_start_date_time (partition key) instead of probe_date_time. This allows ClickHouse to use early cutoff optimization and avoid scanning 27M+ rows just to fetch 30-50 results. Since slot_start_date_time and probe_date_time are nearly identical, the result ordering is unchanged.
1 parent 8e0a6f5 commit f61a61f

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

src/pages/ethereum/data-availability/custody/components/CellProbeDialog/CellProbeDialog.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,8 @@ export function CellProbeDialog({
178178
// Filter by column - uses column_indices_has (array contains)
179179
column_indices_has: cellContext.columnIndex,
180180
page_size: MAX_PROBES,
181-
order_by: 'probe_date_time desc',
181+
// Order by slot_start_date_time (partition key) for efficient ClickHouse early cutoff
182+
order_by: 'slot_start_date_time desc',
182183
// Filter out pre-Fulu slots server-side (PeerDAS only exists after Fulu)
183184
slot_gte: fuluActivation.slot,
184185
};

src/pages/ethereum/data-availability/custody/components/LiveProbeEvents/LiveProbeEvents.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,8 @@ export function LiveProbeEvents({
111111
query: {
112112
...queryParams,
113113
page_size: maxEvents,
114-
order_by: 'probe_date_time desc',
114+
// Order by slot_start_date_time (partition key) for efficient ClickHouse early cutoff
115+
order_by: 'slot_start_date_time desc',
115116
// Filter out pre-Fulu slots server-side (PeerDAS only exists after Fulu)
116117
...(fuluActivation && { slot_gte: fuluActivation.slot }),
117118
},

0 commit comments

Comments
 (0)