Created
October 9, 2015 18:30
-
-
Save jstxx/2d5190e810f3c00a0f44 to your computer and use it in GitHub Desktop.
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
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