-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Description
The current WebSocket client requires row-by-row iteration using wsRows.next() and wsRows.getData(), which creates significant performance bottlenecks for large datasets. This issue requests the addition of bulk query methods to retrieve all results at once, similar to how the REST API works.
Current Behavior
// Current inefficient approach
let sql = 'SELECT * FROM large_table LIMIT 100000';
let wsRows = await wsSql.query(sql);
while (await wsRows.next()) {
let row = wsRows.getData();
// Process each row individually - very slow for large datasets
}
Expected Behavior
// Proposed efficient approach
let sql = 'SELECT * FROM large_table LIMIT 100000';
let result = await wsSql.queryBulk(sql);
let allRows = result.getData(); // Get all rows at once
// Or alternatively:
let allRows = result.getAll();
Performance Issues
-Large Datasets: For queries returning 100K+ rows, the current row-by-row iteration can take 10-30+ minutes
-Network Overhead: Each wsRows.next() call potentially involves network communication
-Memory Inefficiency: Keeping the result set cursor open for extended periods
-Blocking Operations: The sequential nature blocks other operations
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels