Skip to content

Instantly share code, notes, and snippets.

@todiadiyatmo
Last active November 19, 2018 08:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todiadiyatmo/c692d2fc9eec9e113447fb832e61ba85 to your computer and use it in GitHub Desktop.
Save todiadiyatmo/c692d2fc9eec9e113447fb832e61ba85 to your computer and use it in GitHub Desktop.
SQL Kepekan + Redis

Cek string pada options yang panjang

SELECT option_name, LENGTH(option_value), autoload FROM wp_options ORDER BY autoload DESC, option_name ASC;

Delete transient

DELETE FROM `wp_options` WHERE `option_name` LIKE ('_transient_%');
DELETE FROM `wp_options` WHERE `option_name` LIKE ('_site_transient_%');
redis-cli -a [password] --bigkeys

Find long wp options

SELECT option_name, length(option_value)
FROM `wp_2_options`
where autoload='yes'
order by length(option_value) desc


SELECT option_name, length(option_value)/1024
FROM `wp_options`
where autoload='yes'
order by length(option_value) desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment