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

Relations for fields #37

Open
antonzapevalov opened this issue May 21, 2017 · 1 comment
Open

Relations for fields #37

antonzapevalov opened this issue May 21, 2017 · 1 comment

Comments

@antonzapevalov
Copy link

antonzapevalov commented May 21, 2017

I want show list of posts. I am get 10 posts per page. In template for every post i am get acf image. For 10 posts 40 SQL requests are executed. How to set up a normal relations for fields, to run only one query?

@jgrossi
Copy link
Member

jgrossi commented May 25, 2017

Hi @ZapevalovAnton actually that's currently not possible due to how ACF stores data into the WP database. You have to make multiples queries to fetch the custom field type, then others to get the post object and then the content. One of the big improvements to be made into corcel/acf is the performance.

If you take a look on ACF plugin itself we have a lot of queries. Maybe you can work in a PR to reduce the number of queries, creating some complex queries to avoid duplicated one. What do you think?

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

2 participants