Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show deleted_rows_scanned stats in verbose mode #108

Merged

Conversation

takabow
Copy link
Contributor

@takabow takabow commented Mar 9, 2021

The deleted_rows_scanned in QueryStats is usuful for diagnosing bottlenecks in scanned tables with many insertion and deletion.

I added deleted rows scanned section in verbose mode.

Before

spanner> select count(*) from new_orders;
+--------+
|        |
+--------+
| 835790 |
+--------+
1 rows in set (70.49 msecs)
timestamp: 2021-03-09T14:04:10.376489+09:00
cpu:       325.3 msecs
scanned:   835790 rows
optimizer: 2

After

spanner> select count(*) from new_orders;
+--------+
|        |
+--------+
| 835790 |
+--------+
1 rows in set (70.49 msecs)
timestamp:            2021-03-09T14:04:10.376489+09:00
cpu time:             325.3 msecs
rows scanned:         835790 rows
deleted rows scanned: 232750 rows
optimizer version:    2

@google-cla google-cla bot added the cla: yes CLA signed label Mar 9, 2021
@yfuruyama yfuruyama self-requested a review March 9, 2021 06:44
cli.go Outdated
@@ -423,16 +423,19 @@ func resultLine(result *Result, verbose bool) string {
// detail is aligned with max length of key (current: 9)
Copy link
Collaborator

Choose a reason for hiding this comment

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

nit: Could you update this number to 20?

$ echo -n 'deleted rows scanned' | wc -c
      20

@yfuruyama
Copy link
Collaborator

LGTM, thanks!

@yfuruyama yfuruyama merged commit 752e0a0 into cloudspannerecosystem:master Mar 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes CLA signed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants