Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate queries #50

Open
WiredWonder opened this issue Feb 24, 2023 · 0 comments
Open

Duplicate queries #50

WiredWonder opened this issue Feb 24, 2023 · 0 comments

Comments

@WiredWonder
Copy link

Hi there,

With this plugin installed, Query Monitor shows duplicate queries on wp_posts (the largest table on most installs).

For every possible supported post type, each extension calls schema_wp_cpt_get_enabled() which runs

SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_type = 'schema' AND ((wp_posts.post_status = 'publish')) ORDER BY wp_posts.post_date DESC

This happens multiple times per admin page, eg. for audio, video, meta etc. Even if these schema types are disabled.

It also then gets more postmeta records for each schema type.

Surely you can call it once and pass the array, saving some expensive queries?

Cheers,
Jason

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant