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

Support optimizer statistics #119

Merged
merged 1 commit into from
Aug 31, 2021
Merged

Support optimizer statistics #119

merged 1 commit into from
Aug 31, 2021

Conversation

yfuruyama
Copy link
Collaborator

This PR has two changes to support optimizer statistics:

  1. Support ALTER STATISTICS statement.
  2. Show optimizer statistics package name in verbose mode.

Example:

spanner> ALTER STATISTICS auto_20210829_05_22_28UTC SET OPTIONS (allow_gc = false);
Query OK, 0 rows affected (40.93 sec)

spanner> SELECT * FROM Singers;
+----------+-----------+----------+------------+------------+
| SingerId | FirstName | LastName | SingerInfo | BirthDate  |
+----------+-----------+----------+------------+------------+
| 1        | b         | Richards | NULL       | 1970-09-03 |
| 2        | Catalina  | Smith    | NULL       | 1990-08-17 |
| 3        | Alice     | Trentor  | NULL       | 1991-10-02 |
| 4        | Lea       | Martin   | NULL       | 1991-11-09 |
| 5        | David     | Lomond   | NULL       | 1977-01-29 |
+----------+-----------+----------+------------+------------+
5 rows in set (2.75 msecs)
timestamp:            2021-08-31T13:58:59.509876+09:00
cpu time:             0.9 msecs
rows scanned:         5 rows
deleted rows scanned: 0 rows
optimizer version:    2
optimizer statistics: auto_20210829_05_22_28UTC

@google-cla google-cla bot added the cla: yes CLA signed label Aug 31, 2021
@yfuruyama
Copy link
Collaborator Author

@apstndb Could you review this PR when you have a chance? I want to hear feedback about if showing optimizer statistics package name in verbose mode makes sense to you.

@yfuruyama yfuruyama requested a review from apstndb August 31, 2021 05:14
Copy link
Collaborator

@apstndb apstndb left a comment

Choose a reason for hiding this comment

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

I want to hear feedback about if showing optimizer statistics package name in verbose mode makes sense to you.

"optimizer statistics" seems not ambiguous and reasonably short.
LGTM.

Comment on lines 336 to +338
deleted rows scanned: 1 rows
optimizer version: 2
optimizer statistics: auto_20210829_05_22_28UTC
Copy link
Collaborator

Choose a reason for hiding this comment

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

Alignment test 👀

@yfuruyama
Copy link
Collaborator Author

Thanks for reviewing!

"optimizer statistics" seems not ambiguous and reasonably short.

Yeah, I wondered if we should use optimizer statistics package or optimizer statistics, but the former one looks little bit long to me, so I chose optimizer statistics.

@yfuruyama yfuruyama merged commit ed9ae3f into master Aug 31, 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