Skip to content

Instantly share code, notes, and snippets.

@jstxx
Created October 9, 2015 18:30
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 jstxx/2d5190e810f3c00a0f44 to your computer and use it in GitHub Desktop.
Save jstxx/2d5190e810f3c00a0f44 to your computer and use it in GitHub Desktop.
select *
from wp_posts wp
where post_date > '2015-02-01'
order by wp.id desc
select distinct post_status
from wp_posts wp
where post_date > '2015-02-01'
order by wp.id desc
select distinct post_type from wp_posts
SHOW INDEXES FROM wp_posts;
ALTER TABLE wp_posts ADD INDEX test_index (post_date, post_status, post_type);
drop INDEX test_index ON wp_posts
SELECT id
FROM `wp_posts`
WHERE 1=1
and `post_date` > "2014-01-01"
AND `post_date` <= "2015-01-01"
and `post_status` = "publish"
AND `post_type` IN ( "venue", "article", "cartoon", "issue", "listing", "topic" )
SELECT `ID`
FROM `wp_posts`
WHERE `post_date` > '2014-01-01'
AND `post_date` <= "2015-01-01"
AND `post_status` = "publish"
AND `post_type`
IN ( "venue", "article", "cartoon", "issue", "listing", "topic" )
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment