Skip to content

Instantly share code, notes, and snippets.

@Tmeister
Last active November 17, 2016 01:08
Show Gist options
  • Save Tmeister/eca28a27564f40e91aceee678bc1ed82 to your computer and use it in GitHub Desktop.
Save Tmeister/eca28a27564f40e91aceee678bc1ed82 to your computer and use it in GitHub Desktop.
/*
# Time: 2016-11-17T01:05:06.879587Z
# User@Host: -----[-----] @ localhost [127.0.0.1] Id: 1150
# Query_time: 60.799160 Lock_time: 0.000680 Rows_sent: 14 Rows_examined: 209299
*/
SELECT SQL_CALC_FOUND_ROWS wp_s3bgzgx9jq_posts.ID FROM wp_s3bgzgx9jq_posts LEFT JOIN wp_s3bgzgx9jq_postmeta
AS tve_pm ON (wp_s3bgzgx9jq_posts.ID = tve_pm.post_id) WHERE 1=1
AND ( ((tve_pm.meta_key = 'tve_save_post') AND (tve_pm.meta_value LIKE '%Box%'))
OR ((tve_pm.meta_key = 'tve_save_post') AND (tve_pm.meta_value LIKE '%mods%'))
OR ((wp_s3bgzgx9jq_posts.post_title LIKE '%Box%')
OR (wp_s3bgzgx9jq_posts.post_excerpt LIKE '%Box%')
OR (wp_s3bgzgx9jq_posts.post_content LIKE '%Box%')
OR (wp_s3bgzgx9jq_posts.post_content REGEXP '\\[table id=(["\']?)(58|70)([\]"\' /])'))
AND ((wp_s3bgzgx9jq_posts.post_title LIKE '%mods%')
OR (wp_s3bgzgx9jq_posts.post_excerpt LIKE '%mods%')
OR (wp_s3bgzgx9jq_posts.post_content LIKE '%mods%')
OR (wp_s3bgzgx9jq_posts.post_content REGEXP '\\[table id=(["\']?)(16)([\]"\' /])')))
AND (wp_s3bgzgx9jq_posts.post_password = '')
AND wp_s3bgzgx9jq_posts.post_type IN ('post', 'page', 'attachment')
AND (wp_s3bgzgx9jq_posts.post_status = 'publish'
OR wp_s3bgzgx9jq_posts.post_status = 'acf-disabled')
GROUP BY wp_s3bgzgx9jq_posts.ID ORDER BY
(CASE WHEN wp_s3bgzgx9jq_posts.post_title LIKE '%Box mods%' THEN 1 WHEN wp_s3bgzgx9jq_posts.post_title
LIKE '%Box%'
AND wp_s3bgzgx9jq_posts.post_title
LIKE '%mods%' THEN 2 WHEN wp_s3bgzgx9jq_posts.post_title
LIKE '%Box%' OR wp_s3bgzgx9jq_posts.post_title
LIKE '%mods%' THEN 3 WHEN wp_s3bgzgx9jq_posts.post_excerpt
LIKE '%Box mods%' THEN 4 WHEN wp_s3bgzgx9jq_posts.post_content
LIKE '%Box mods%' THEN 5 ELSE 6 END), wp_s3bgzgx9jq_posts.post_date
DESC LIMIT 0, 14;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment