I can get a list of all columns I want to verify the space available.
SELECT
TABLE_NAME, COLUMN_NAME, COLUMN_TYPE
FROM
INFORMATION_SCHEMA.COLUMNS
WHERE
COLUMN_TYPE = 'int(11)' AND
TABLE_NAME LIKE 'catalog_category_entity%';
Considering that int(11) is up to 2147483648 (not considering unsigned) I would like to calculate how much I am using from this range.
Individually I could check one like this:
select
max(value_id)/2147483648 as usage
from
catalog_product_entity_int;
But I would like to do each on a nice way for all the columns found on the first query.
I would like to know if recursive CTE is the right resource in this case and how to do it or if there is a more elegant way of checking it.
I would like to have this nice quick way of checking without any external tools.
I've found this solution for postgres but I was wondering if I really need the function. postgres: find all integer columns with its current max value in it