Created
September 1, 2017 13:34
-
-
Save dannyfallon/974737d887f3270dc2c237a2188c7014 to your computer and use it in GitHub Desktop.
Determining what tables with an auto incrementing primary key are coming close to the max of the int datatype (80%)
This file contains 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
SELECT t.TABLE_NAME, `AUTO_INCREMENT` | |
FROM information_schema.TABLES AS t | |
JOIN information_schema.COLUMNS AS c ON ( | |
c.COLUMN_NAME = 'id' AND | |
c.TABLE_SCHEMA = t.TABLE_SCHEMA AND | |
c.TABLE_NAME = t.TABLE_NAME AND | |
c.`DATA_TYPE` = 'int' | |
) | |
WHERE AUTO_INCREMENT > 1717986918; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment