perf(snowflake-driver): Combine session init into a single ALTER SESSION#11010
Conversation
initConnection issued three separate `ALTER SESSION SET` statements (TIMEZONE, STATEMENT_TIMEOUT_IN_SECONDS, QUOTED_IDENTIFIERS_IGNORE_CASE), each a blocking network round-trip on every connection (re)establishment. Collapse them into one statement via a `buildAlterSessionSql` helper, dropping connection init from 4 sequential round-trips (connect + 3 ALTERs) to 2 (connect + 1 ALTER). Values are interpolated rather than bound: Snowflake does not support bind variables in `ALTER SESSION SET` (verified against a live instance — it rejects `?` with "invalid value [?] for parameter"). The inputs are internal and type-validated, so there is no injection risk.
|
Claude finished @ovr's task in 54s —— View job Code ReviewVerdict: LGTM — 2 low-severity nits. Click to expand.Tasks
SummaryThe change is correct and the perf win is real (3 round-trips → 1). The PR body justification (Snowflake rejects binds in Nits (low severity)
Nothing blocking — feel free to ship. |
Codecov Report✅ All modified and coverable lines are covered by tests.
Additional details and impacted files@@ Coverage Diff @@
## master #11010 +/- ##
===========================================
- Coverage 83.32% 58.57% -24.75%
===========================================
Files 255 216 -39
Lines 77261 17181 -60080
Branches 0 3502 +3502
===========================================
- Hits 64378 10064 -54314
+ Misses 12883 6609 -6274
- Partials 0 508 +508
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
initConnection issued three separate
ALTER SESSION SETstatements (TIMEZONE, STATEMENT_TIMEOUT_IN_SECONDS, QUOTED_IDENTIFIERS_IGNORE_CASE), each a blocking network round-trip on every connection (re)establishment.Collapse them into one statement via a
buildAlterSessionSqlhelper, dropping connection init from 4 sequential round-trips (connect + 3 ALTERs) to 2 (connect + 1 ALTER).Values are interpolated rather than bound: Snowflake does not support bind variables in
ALTER SESSION SET(verified against a live instance — it rejects?with "invalid value [?] for parameter"). The inputs are internal and type-validated, so there is no injection risk.