Skip to content

Commit 599c715

Browse files
authored
fix(query): reduce redundant result-set-spill logs during query waits (#18741)
During long-running SQL queries, the system repeatedly logs empty pages with rows=0 which creates excessive log noise. This change only logs non-empty pages and final completion status. Changes: - Skip logging empty pages (rows=0) during query execution - Only log when pages contain actual data (rows>0) - Log final completion status when query ends with empty page - Preserve all error and cleanup logs for debugging This significantly reduces log volume while maintaining visibility into actual data processing and query completion.
1 parent e9262e8 commit 599c715

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

src/query/service/src/servers/http/v1/query/page_manager.rs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -80,17 +80,20 @@ impl PageManager {
8080
let duration_ms = start_time.elapsed().as_millis();
8181

8282
log::debug!(num_row, wait_type:? = wait; "collect_new_page");
83-
log::info!(
84-
target: "result-set-spill",
85-
"[RESULT-SET-SPILL] Page received page_no={}, rows={}, total_rows={}, end={}, duration_ms={}",
86-
self.total_pages, num_row, self.total_rows + num_row, end, duration_ms
87-
);
8883

89-
if num_row == 0 {
84+
// Only log non-empty pages to avoid spam during long SQL waits
85+
if num_row > 0 {
86+
log::info!(
87+
target: "result-set-spill",
88+
"[RESULT-SET-SPILL] Page received page_no={}, rows={}, total_rows={}, end={}, duration_ms={}",
89+
self.total_pages, num_row, self.total_rows + num_row, end, duration_ms
90+
);
91+
} else if end {
92+
// Only log empty page when query ends
9093
log::info!(
9194
target: "result-set-spill",
92-
"[RESULT-SET-SPILL] Empty page page_no={}, end={}",
93-
self.total_pages, end
95+
"[RESULT-SET-SPILL] Query completed with empty final page page_no={}, total_rows={}",
96+
self.total_pages, self.total_rows
9497
);
9598
}
9699

0 commit comments

Comments
 (0)