Skip to content

sql: ensure spans get anonymized in plan collection#34902

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190214-anon-spans
Feb 25, 2019
Merged

sql: ensure spans get anonymized in plan collection#34902
craig[bot] merged 1 commit intocockroachdb:masterfrom
knz:20190214-anon-spans

Conversation

@knz
Copy link
Copy Markdown
Contributor

@knz knz commented Feb 14, 2019

Fixes #34889.

Release note (bug fix): The logical plans collected for display in the
web UI now also hide the details of which key ranges are scanned in
table lookups.

@knz knz requested review from a team, celiala and jordanlewis February 14, 2019 12:28
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@jordanlewis jordanlewis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @celiala, @jordanlewis, and @knz)


pkg/sql/explain_tree.go, line 77 at r1 (raw file):

		},
		spans: func(nodeName, fieldName string, index *sqlbase.IndexDescriptor, spans []roachpb.Span) {
			spanss := sqlbase.PrettySpans(index, spans, 2)

The performance trouble here was that it's expensive to serialize long span strings. It's unfortunate that we're still calling PrettySpans, just to check to see whether the output is - or not. Can you introduce a function spans.FullScan or something that returns a boolean instead?

Now that I look, it's not trivial to write that function, so if you don't feel like it, maybe add a TODO or file an issue.


pkg/sql/walk.go, line 523 at r1 (raw file):

		if v.observer.attr != nil {
			v.observer.attr(name, "from", n.desc.Name)
			spans := sqlbase.PrettySpans(&n.desc.PrimaryIndex, n.spans, 2)

There is also a call to PrettySpans here.

@knz knz force-pushed the 20190214-anon-spans branch from e513c08 to f791112 Compare February 25, 2019 15:28
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

TFYR!

bors r+

Copy link
Copy Markdown
Contributor Author

@knz knz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @celiala and @jordanlewis)


pkg/sql/explain_tree.go, line 77 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

The performance trouble here was that it's expensive to serialize long span strings. It's unfortunate that we're still calling PrettySpans, just to check to see whether the output is - or not. Can you introduce a function spans.FullScan or something that returns a boolean instead?

Now that I look, it's not trivial to write that function, so if you don't feel like it, maybe add a TODO or file an issue.

Done.


pkg/sql/walk.go, line 523 at r1 (raw file):

Previously, jordanlewis (Jordan Lewis) wrote…

There is also a call to PrettySpans here.

Done.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Build failed

@knz knz force-pushed the 20190214-anon-spans branch from f791112 to 0867873 Compare February 25, 2019 16:14
@knz knz requested a review from a team February 25, 2019 16:14
@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r+

Release note (bug fix): The logical plans collected for display in the
web UI now also hide the details of which key ranges are scanned in
table lookups.
@knz knz force-pushed the 20190214-anon-spans branch from 0867873 to 6640333 Compare February 25, 2019 22:19
@knz knz requested a review from a team as a code owner February 25, 2019 22:19
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Canceled

@knz
Copy link
Copy Markdown
Contributor Author

knz commented Feb 25, 2019

bors r+

craig bot pushed a commit that referenced this pull request Feb 25, 2019
34806: util/mon: Downgrade "bytes usage increases" log message r=knz a=bdarnell

This message can be logged frequently in certain workloads, and its
appearance in the info log is not actionable since there is no way to
tie it back to the query that caused it. I see no reason to have
these messages enabled by default.

Release note: None

34886: storage/engine,libroach: 1x write amplification on ingest sst r=dt a=dt

This uses the new flag added in facebook/rocksdb#4172 to avoid needing to make global_seq_no-related edits to SSTs, and thus avoid the SST copying those edits forced us to do to preserve the raft log immutability when hard-linking directly to side load SSTs.

This is gated on a cluster version that is defined well after the upgrade to rocks 5.17, since using the flag requires that no older versions of RocksDB (<5.16),
will ever be used to read these SSTs, as they will lack the seq_no that the older versions need for correctness.

Release note (performance improvement): reduce write-amplification during bulk-loading (IMPORT and RESTORE)

34902: sql: ensure spans get anonymized in plan collection r=knz a=knz

Fixes #34889.

Release note (bug fix): The logical plans collected for display in the
web UI now also hide the details of which key ranges are scanned in
table lookups.

Co-authored-by: Ben Darnell <ben@bendarnell.com>
Co-authored-by: David Taylor <tinystatemachine@gmail.com>
Co-authored-by: Raphael 'kena' Poss <knz@cockroachlabs.com>
@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 25, 2019

Build succeeded

@craig craig bot merged commit 6640333 into cockroachdb:master Feb 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

sql: sampled query plans do not have attributes anonymized

3 participants