-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Publish table size on schema #7444
Conversation
555a136
to
df42e86
Compare
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
27ee118
to
46a09f7
Compare
Signed-off-by: Andres Taylor <[email protected]>
… difficult table names Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Andres Taylor <[email protected]>
Signed-off-by: Harshit Gangal <[email protected]>
db.AddQueryPattern(baseShowTablesPattern, | ||
&sqltypes.Result{ | ||
Fields: mysql.BaseShowTablesFields, | ||
RowsAffected: 0, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: no need to spell out default values
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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 | ||
` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
continue | ||
if !curTables[tableName] { | ||
dropped = append(dropped, tableName) | ||
delete(se.tables, tableName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
tbl, isInTablesMap := se.tables[tableName] | ||
if isInTablesMap && createTime < se.lastChange { | ||
tbl.FileSize = fileSize | ||
tbl.AllocatedSize = allocatedSize |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
Description
Adds more information per table in the exposed tablet metrics. They now include
FileSize
andAllocatedSize
.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: