You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/claude/backlog.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,9 +24,9 @@ The endpoint ships with SQLBatch + RPC + Transaction Manager support and credent
24
24
25
25
- **Tool shakedown** — point real client tools at the endpoint and harvest their exotic catalog queries / SET shapes into this backlog. Tool scope (user decision, 2026-07-16): tools a SQL Server + .NET developer already has — SSMS, sqlcmd, Visual Studio (SQL Server Object Explorer / DacFx), LINQPad; DBA-flavored tools like DBeaver are out of scope. **SSMS is the final boss** — an ongoing campaign, not a single leg: each surface is its own multi-round harvest, and clearing one unlocks the next. Cleared legs are recorded in the per-feature deep-dives (catalog surface in [`catalog-views.md`](catalog-views.md), wire behavior in [`tds-endpoint.md`](tds-endpoint.md)); the discovery harnesses are the gitignored `.vs/ssms-host` TDS host and the headless SMO property-bag drain. **Remaining frontier**: Table Designer, Activity Monitor, standard reports, and IntelliSense's background metadata harvest. (The sp_cursor* API-server-cursor RPC family — SSMS query-editor grid navigation / multi-row edit — shipped; see [`tds-endpoint.md`](tds-endpoint.md).) Candidate follow-on legs within tool scope: Visual Studio's SQL Server Object Explorer (DacFx-driven, a different query dialect from SMO) and LINQPad.
26
26
- **SMO API sweep campaign** — `.vs/smo-sweep` (gitignored local harness) walks SMO's full reachable read surface against the self-hosted simulator and, identically, against the live reference, draining every `Property.Value` and `Script()`-ing every `IScriptable`; modes `sweep` / `sweep --live` / `diff` → sorted JSON reports + `reports/triage.md`; workflow = sweep both sides → triage → fix bundles → graduated `Tests.Smo` tests → re-sweep. Open items from the latest triage: (a) `DBCC SHOW_STATISTICS … WITH STATS_STREAM` (SMO `Statistic.Stream`) stays `NotSupportedException` — it wants the raw serialized statistics-histogram blob, which the simulator has no faithful source for; (b) the unmodeled runtime/OS surfaces SMO reaches as absent objects (backup history `msdb.dbo.backupset`, `sys.dm_tran_persistent_version_store_stats`, file-space/IO DMVs, `sys.dm_os_process_memory`, `master.dbo.sysprocesses`, `FILEPROPERTY`, registry/OS xps) — surfaced as `PropertyCannotBeRetrievedException` / defaults, the legitimate-gap category.
27
-
-**ORDER BY result sets ride encoded `byte[]` rows** through the reader-cursor decode path instead of the projected `SqlValue[]` fast path the unordered FROM-bearing SELECT takes — an encode-then-re-decode round-trip per row. The next large-result-drain throughput lever (DacFx export chunks all carry ORDER BY, so it taxes every export row).
28
27
-**Wire forms deferred by the codec**: `text`/`ntext`/`image` (textptr ROW form + table-name-bearing COLMETADATA); `sql_variant` RPC *parameters* (the result-column form ships — see [`tds-endpoint.md`](tds-endpoint.md); candidates for true-variant migration off inner-type substitution: SERVERPROPERTY / SESSIONPROPERTY / CONNECTIONPROPERTY / COLLATIONPROPERTY / LOGINPROPERTY / SESSION_CONTEXT / `sys.configurations`); UDT *parameters* for `geography`/`geometry`/`hierarchyid` (their result-column forms ship). **TVP parameters (0xF3, `SqlDbType.Structured`) ship** — `DataTable` / `IEnumerable<SqlDataRecord>` / `DbDataReader` sources over proc-RPC + sp_executesql, error parity for arity / type / NOT NULL / CHECK / PK / UNIQUE / unknown-type; see [`tds-endpoint.md`](tds-endpoint.md#tvp-parameters-sqldbtypestructured). Residual: `sql_variant` / UDT *columns inside* a TVP still reject.
29
28
-**Smaller fidelity items**: mid-stream attention (cancel during a large result requires a concurrent reader); MARS; TDS 8.0 / `Encrypt=Strict` (ALPN via `SslApplicationProtocol`); user-supplied `X509Certificate2`; off-loopback binding — the last two are add-on-demand public-surface expansions.
29
+
-**Chunked `OFFSET/FETCH` re-sorts the whole set per page**: an `ORDER BY … OFFSET @o FETCH @f` paginated drain (the DacFx chunked-export shape) buffers and sorts the entire result on every chunk, then skip/takes the page — so N chunks pay N full sorts (measured ~10× the single-sort µs/row at 15 chunks over 150k rows). The projection/drain representation is already the decoded-once `SqlValue[]` fast path (single-SELECT ORDER BY sorts projected rows, no byte[] re-decode — the prior gap here is closed); this residual is redundant re-sorting across pages, not a decode round-trip. A "sort once, serve many pages" lever would need cross-execution result caching the plan cache doesn't currently model.
Copy file name to clipboardExpand all lines: docs/claude/query.md
+5Lines changed: 5 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -21,6 +21,11 @@
21
21
- TOP + OFFSET → **Msg 10741**.
22
22
- Counts resolve at parse time (constants, parameters, arithmetic).
23
23
24
+
## Result drain / ORDER BY representation
25
+
The FROM-bearing SELECT projection paths — streaming, buffered (ORDER BY / DISTINCT), windowed, and aggregate — all yield already-projected `SqlValue[]` rows, so `SimulatedSqlResultSet` serves the reader and TDS cursors directly with no encode-then-re-decode round-trip (see the `SimulatedSqlResultSet` doc + [`data-reader.md`](data-reader.md)). **ORDER BY on a single SELECT sorts those projected `SqlValue[]` rows** (`ProjectBuffered.materialized.Sort`), so ordered drains ride the same decoded-once fast path as unordered ones; the only ordered-vs-unordered cost is the inherent buffer + per-row key computation + `List.Sort`, not a decode round-trip, and peak retained memory is effectively unchanged (measured within 0.2% on a 150k-row wide drain).
26
+
27
+
The **top-level ORDER BY after a set-op chain** (`ApplyTopLevelOrderBy`) is the exception: the inner UNION / INTERSECT / EXCEPT chain yields byte[] rows natively (branch dedup / coercion re-encode), so that path keeps the byte[] form through the sort and lets the drain cursor decode once — eagerly decoding every column into `SqlValue[]` for the whole buffer measured slower and heavier (strings re-materialized and retained across the sort). Sort keys decode only the ORDER BY columns off each row (`ComputeTopLevelOrderKeys`), not the full tuple.
0 commit comments