Skip to content

Instantly share code, notes, and snippets.

View ostark's full-sized avatar

Oliver Stark ostark

  • Berlin area, countryside
View GitHub Profile
@ostark
ostark / schema_auto_increment_columns.sql
Created December 4, 2024 14:17 — forked from bennadel/schema_auto_increment_columns.sql
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.