Skip to content

Commit

Permalink
sql: added indexes to system.statement_statistics, system.transaction…
Browse files Browse the repository at this point in the history
…_statistics

Fixes cockroachdb#98624.

This commit adds indexes on new computed columns to the
system.statement_statistics and system.transaction_statistics
tables.

Epic: none

Release note: None
  • Loading branch information
ericharmeling committed Mar 20, 2023
1 parent ea389ff commit d081e5a
Show file tree
Hide file tree
Showing 17 changed files with 987 additions and 25 deletions.
2 changes: 1 addition & 1 deletion docs/generated/settings/settings-for-tenants.txt
Original file line number Diff line number Diff line change
Expand Up @@ -299,4 +299,4 @@ trace.opentelemetry.collector string address of an OpenTelemetry trace collecto
trace.snapshot.rate duration 0s if non-zero, interval at which background trace snapshots are captured
trace.span_registry.enabled boolean true if set, ongoing traces can be seen at https://<ui>/#/debug/tracez
trace.zipkin.collector string the address of a Zipkin instance to receive traces, as <host>:<port>. If no port is specified, 9411 will be used.
version version 1000022.2-90 set the active cluster version in the format '<major>.<minor>'
version version 1000022.2-92 set the active cluster version in the format '<major>.<minor>'
2 changes: 1 addition & 1 deletion docs/generated/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,6 @@
<tr><td><div id="setting-trace-snapshot-rate" class="anchored"><code>trace.snapshot.rate</code></div></td><td>duration</td><td><code>0s</code></td><td>if non-zero, interval at which background trace snapshots are captured</td></tr>
<tr><td><div id="setting-trace-span-registry-enabled" class="anchored"><code>trace.span_registry.enabled</code></div></td><td>boolean</td><td><code>true</code></td><td>if set, ongoing traces can be seen at https://&lt;ui&gt;/#/debug/tracez</td></tr>
<tr><td><div id="setting-trace-zipkin-collector" class="anchored"><code>trace.zipkin.collector</code></div></td><td>string</td><td><code></code></td><td>the address of a Zipkin instance to receive traces, as &lt;host&gt;:&lt;port&gt;. If no port is specified, 9411 will be used.</td></tr>
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000022.2-90</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td></tr>
<tr><td><div id="setting-version" class="anchored"><code>version</code></div></td><td>version</td><td><code>1000022.2-92</code></td><td>set the active cluster version in the format &#39;&lt;major&gt;.&lt;minor&gt;&#39;</td></tr>
</tbody>
</table>
2 changes: 1 addition & 1 deletion pkg/cli/testdata/declarative-rules/deprules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dep
----
debug declarative-print-rules 1000022.2-90 dep
debug declarative-print-rules 1000022.2-92 dep
deprules
----
- name: 'CheckConstraint transitions to ABSENT uphold 2-version invariant: PUBLIC->VALIDATED'
Expand Down
2 changes: 1 addition & 1 deletion pkg/cli/testdata/declarative-rules/oprules
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
op
----
debug declarative-print-rules 1000022.2-90 op
debug declarative-print-rules 1000022.2-92 op
rules
----
[]
10 changes: 10 additions & 0 deletions pkg/clusterversion/cockroach_versions.go
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,12 @@ const (
// config runner persistent job has been created.
V23_1_CreateAutoConfigRunnerJob

// V23_1AddSQLStatsComputedIndexes is the version at which Cockroach adds new
// computed columns and indexes to the statement_statistics and
// transaction_statistics system tables. These columns optimize persisted SQL
// statistics queries for observability.
V23_1AddSQLStatsComputedIndexes

// *************************************************
// Step (1): Add new versions here.
// Do not add new versions to a patch release.
Expand Down Expand Up @@ -863,6 +869,10 @@ var rawVersionsSingleton = keyedVersions{
Key: V23_1_CreateAutoConfigRunnerJob,
Version: roachpb.Version{Major: 22, Minor: 2, Internal: 90},
},
{
Key: V23_1AddSQLStatsComputedIndexes,
Version: roachpb.Version{Major: 22, Minor: 2, Internal: 92},
},

// *************************************************
// Step (2): Add new versions here.
Expand Down
12 changes: 6 additions & 6 deletions pkg/sql/catalog/bootstrap/testdata/testdata

Large diffs are not rendered by default.

Loading

0 comments on commit d081e5a

Please sign in to comment.