-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
The buffer appears to only allow about 50K of data to be returned in a large query causing hangs and connection pooling polution:
From my internal document
- ✅ Found PRIMARY BOTTLENECK: Hardcoded 200-row fetch limit (sql.go:401)
- Issue SQL Functions (UPPER/LOWER) + JOINs Cause Hang **Severity:** ⚠️ CRITICAL #6 (Large data hang): Hardcoded 200-row limit + no timeout
From my API Code:
- Buffer Size Constants:
- SQL Chunk Size: 31,904 bytes (message.go:101) - NOT the issue
- Max Rows Per Fetch: 200 (sql.go:401) - PRIMARY BOTTLENECK
- Query Timeout: 10 seconds (sql.go:400) - doesn't protect data fetching
- List Item Boundary: 253 bytes (listitem.go:82) - already fixed
Working on returning a result set on my project table:
- Root Cause of Issue SQL Functions (UPPER/LOWER) + JOINs Cause Hang **Severity:** ⚠️ CRITICAL #6 (Large data hang):
- Product table: 8× VARCHAR(1024) = ~8KB per row
- 200 rows × 8KB = 1.6MB theoretical
- With 2 JOINs: 2-3MB actual
- Server can't send oversized batch → hangs at row 9-15
- Driver waits forever (no timeout) → infinite hang
Recommendations:
- sql.go:401 - Make maxRows configurable
- sql.go:129-143 - Add timeout to fetchMoreData()
- mod.go - Add maxRowsPerFetch field to Connection struct
- url.go - Parse maxRows from DSN
Metadata
Metadata
Assignees
Labels
No labels