Publish table size on schema #7444
Merged
systay merged 14 commits intovitessio:masterfrom Feb 9, 2021
Merged
Conversation
555a136 to
df42e86
Compare
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
27ee118 to
46a09f7
Compare
deepthi
reviewed
Feb 5, 2021
Signed-off-by: Andres Taylor <andres@planetscale.com>
… difficult table names Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Andres Taylor <andres@planetscale.com>
Signed-off-by: Harshit Gangal <harshit@planetscale.com>
systay
reviewed
Feb 9, 2021
| db.AddQueryPattern(baseShowTablesPattern, | ||
| &sqltypes.Result{ | ||
| Fields: mysql.BaseShowTablesFields, | ||
| RowsAffected: 0, |
Collaborator
There was a problem hiding this comment.
nit: no need to spell out default values
shlomi-noach
approved these changes
Feb 9, 2021
Contributor
shlomi-noach
left a comment
There was a problem hiding this comment.
Looks legit! I like the per-version queries, and they seem good.
| FROM information_schema.tables t | ||
| WHERE table_schema = database() AND NOT EXISTS(SELECT * FROM information_schema.innodb_sys_tablespaces i WHERE i.name = concat(t.table_schema,'/',t.table_name)) | ||
| group by table_name, table_type, unix_timestamp(create_time), table_comment | ||
| ` |
| continue | ||
| if !curTables[tableName] { | ||
| dropped = append(dropped, tableName) | ||
| delete(se.tables, tableName) |
| tbl, isInTablesMap := se.tables[tableName] | ||
| if isInTablesMap && createTime < se.lastChange { | ||
| tbl.FileSize = fileSize | ||
| tbl.AllocatedSize = allocatedSize |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Adds more information per table in the exposed tablet metrics. They now include
FileSizeandAllocatedSize.From the mysql docs:
We do this by extending the query we already use to keep track of tables on the server so it returns more data.
Impacted Areas in Vitess
Components that this PR will affect: