Created
November 22, 2023 12:30
-
-
Save thomasgriffin/83b3d5360ea888d38066bd2a80d9a47d to your computer and use it in GitHub Desktop.
Helpful indexes and SQL queries to add to make WordPress run faster.
This file contains hidden or 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
alter table `wp_usermeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_postmeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_termmeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_commentmeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_edd_customermeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_edd_licensemeta` add index `ndx_meta_key_meta_val1` (`meta_key`(40), `meta_value`(191)); | |
alter table `wp_posts` add index `ndx_id_post_status_val1` (`id`, `post_status`); | |
SELECT 'autoloaded data in KiB' as name, ROUND(SUM(LENGTH(option_value))/ 1024) as value FROM wp_options WHERE autoload='yes' | |
UNION | |
SELECT 'autoloaded data count', count(*) FROM wp_options WHERE autoload='yes' | |
UNION | |
(SELECT option_name, length(option_value) FROM wp_options WHERE autoload='yes' ORDER BY length(option_value) DESC LIMIT 10); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment