Commit bb8844a
155485: sql: deprecate `SCRUB` command r=bghal a=bghal
Trimmed the `SCRUB` implementation down to a notice directing users to
the `INSPECT` command. The `pkg/sql/scrub` errors package is left intact
as it's still used in a number of other packages.
A test helper is updated to use `INSPECT` and `SHOW INSPECT ERRORS`
commands.
Fixes: cockroachdb#148274
Epic: CRDB-55075
Release note (sql change): The `EXPERIMENTAL SCRUB` command is
deprecated. The `INSPECT` command should be used for data consistency
validation.
156152: sql: implement EXPLAIN (FINGERPRINT) statement r=yuzefovich,DrewKimball a=michae2
**sql, tree: move two formatting helper functions into tree**
Move `formatStatementHideConstants` and `formatStatementSummary` from sql to tree so that we can call `tree.FormatStatementHideConstants` from the optbuilder package.
Epic: None
Release note: None
---
**sql: implement EXPLAIN (FINGERPRINT) statement**
This commit adds support for EXPLAIN (FINGERPRINT), a new EXPLAIN variant that returns statement fingerprints. Statement fingerprints are normalized forms of SQL statements where constants are replaced with underscores, making them useful for query pattern analysis and monitoring.
Key features:
- Returns a single row with single string column containing statement fingerprint
- Respects sql.stats.statement_fingerprint.format_mask cluster setting
Implementation details:
- Added ExplainFingerprint mode to AST with validation
- Implemented fingerprint computation during optbuild phase
- Added telemetry tracking for usage
- Comprehensive test coverage including edge cases and prepared statements
Examples:
- EXPLAIN (FINGERPRINT) SELECT * FROM t WHERE a = 123 Returns: "SELECT * FROM t WHERE a = _"
Informs: cockroachdb#153633
Release note (sql change): Added EXPLAIN (FINGERPRINT) statement that returns normalized statement fingerprints with constants replaced by underscores.
🤖 Generated with [Claude Code](https://claude.ai/code)
156509: kvserver: pass struct into SetRangeAppliedState r=stevendanna a=pav-kv
The signature of this method was error-prone and verbose. All the callers copy the `RangeAppliedState` from `ReplicaState` fields, or already have a fully populated `RangeAppliedState`.
Forked from the work in cockroachdb#156495
Epic: none
Release note: none
Co-authored-by: Brendan Gerrity <[email protected]>
Co-authored-by: Michael Erickson <[email protected]>
Co-authored-by: Pavel Kalinnikov <[email protected]>
File tree
44 files changed
+441
-3049
lines changed- pkg
- ccl/partitionccl
- kv/kvserver
- kvserverpb
- kvstorage
- sql
- logictest/testdata/logic_test
- opt
- exec/execbuilder
- testdata
- tests/local
- ops
- optbuilder
- pgwire
- scrub
- scrubtestutils
- sem/tree
- sessiondatapb
- sessionmutator
- sqltelemetry
- testutils/sqlutils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
44 files changed
+441
-3049
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2315 | 2315 | | |
2316 | 2316 | | |
2317 | 2317 | | |
2318 | | - | |
2319 | 2318 | | |
2320 | 2319 | | |
2321 | 2320 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
41 | 40 | | |
42 | 41 | | |
43 | 42 | | |
| |||
69 | 68 | | |
70 | 69 | | |
71 | 70 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 71 | | |
76 | 72 | | |
77 | 73 | | |
| |||
0 commit comments