Skip to content

Support FORCE INDEX #45

@adamziel

Description

@adamziel

bbPress uses the following query:

SELECT SQL_CALC_FOUND_ROWS wp_posts.* 
FROM wp_posts 
FORCE INDEX (PRIMARY, post_parent) 
WHERE 1=1 
AND (wp_posts.ID = 8 OR wp_posts.post_parent = 8) 
AND ((wp_posts.post_type = 'topic' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden')) OR (wp_posts.post_type = 'reply' AND (wp_posts.post_status = 'publish' OR wp_posts.post_status = 'closed' OR wp_posts.post_status = 'private' OR wp_posts.post_status = 'hidden'))) 
ORDER BY wp_posts.post_date ASC LIMIT 0, 15

Which fails, most likely due to the FORCE INDEX (PRIMARY, post_parent) part.

SQLite counterpart is INDEXED BY, although FORCE INDEX is going to be deprecated in MySQL so perhaps ignoring that part of the query in the rewriting engine would be an acceptable resolution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions