Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
SELECT
'Autoload KB' as name, ROUND( SUM( LENGTH( option_value ) ) / 1024 ) as size, null as autoload
FROM wp_options
WHERE autoload = 'yes'
UNION
SELECT 'Autoload count', count( * ), null as autoload
FROM wp_options
WHERE autoload = 'yes'
UNION (
SELECT option_name, length( option_value ), autoload
FROM wp_options
WHERE autoload = 'yes'
ORDER BY length( option_value ) DESC
LIMIT 20
)
UNION (
SELECT option_name, length( option_value ), autoload
FROM wp_options
WHERE autoload = 'no'
ORDER BY length( option_value ) DESC
LIMIT 20
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment