Skip to content

Instantly share code, notes, and snippets.

@onebelarusianguy
Last active June 28, 2020 11:07
Show Gist options
  • Select an option

  • Save onebelarusianguy/3212ea047ad6134276c36c705aad469f to your computer and use it in GitHub Desktop.

Select an option

Save onebelarusianguy/3212ea047ad6134276c36c705aad469f to your computer and use it in GitHub Desktop.
# to avoid #1067 - Invalid default value for 'post_date' ERROR:
SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET AUTOCOMMIT = 0;
START TRANSACTION;
SET time_zone = "+00:00";
# then remove INDEX:
ALTER TABLE wp_posts DROP INDEX post_type_post_title;
# show MySQL indexes
SHOW INDEX FROM wp_posts;
# add index
CREATE FULLTEXT INDEX post_content ON wp_posts(post_content);
# less rows in this order
CREATE INDEX views_post_type ON wp_posts(views, post_type);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment