Skip to content

Instantly share code, notes, and snippets.

View dust63's full-sized avatar

Romain J dust63

View GitHub Profile
@bennadel
bennadel / schema_auto_increment_columns.sql
Created December 20, 2020 13:53
Looking For Database Performance Bottlenecks And Optimizations Using The Sys Schema In MySQL 5.7
/**
* Find the amount of auto-increment "space" has been used. This may can help identify
* tables that are running out of available ID values.
*/
SELECT
t.table_name,
t.column_name,
-- The highest possible ID that can be created with this data-type.
t.max_value,
-- The last ID created in this table.