Skip to content

Instantly share code, notes, and snippets.

@albatarnik
albatarnik / schema_auto_increment_columns.sql
Created March 15, 2022 14:21 — 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.
; Start a new pool named 'www'.
; the variable $pool can be used in any directive and will be replaced by the
; pool name ('www' here)
[www]
; Per pool prefix
; It only applies on the following directives:
; - 'access.log'
; - 'slowlog'
; - 'listen' (unixsocket)
;;;;;;;;;;;;;;;;;;;;;
; FPM Configuration ;
;;;;;;;;;;;;;;;;;;;;;
; All relative paths in this configuration file are relative to PHP's install
; prefix (/usr). This prefix can be dynamically changed by using the
; '-p' argument from the command line.
;;;;;;;;;;;;;;;;;;
; Global Options ;