Support » Plugin: Pods - Custom Content Types and Fields » Is there a way to reduce number of query ran by PODS

  • Resolved jayhtml

    (@jayhtml)


    Hi,

    I added a custom field, image to the category, using PODS. While doing site audit, I found out that PODS made 70 queries just to get this image field, I noticed a lot of the query are get_option(‘_transient.

    Even on page where I am not using PODS, I still get a lot of PODS related query being ran on the page.

    To do the same in ACF, only 3 query are needed and the total execution time is 7 times faster.

    Is there a way to reduce the number of these query? I want to continue to use PODS for this team project.

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Can you clarify how you are outputting the image field using Pods and how you were doing it with ACF? That may help us understand what’s going on here.

    Thread Starter jayhtml

    (@jayhtml)

    This is the code for ACF:
    get_field('profile_picture', 'post_tag_' . get_queried_object_id());

    This is the code for PODS:
    pods_field('category', get_queried_object_id(), 'profile_picture'); then I use guid of the return array to get the url for the image.

    I also see a lot of query like get_option('_transient_pods_8a89b940c18079b70cb5f4148c5b5942'), even on pages where I am not displaying anything related to PODS.

    Plugin Author Jory Hogeveen

    (@keraweb)

    Hi @jayhtml

    The options you are referring to are called “Transients” and it’s a form of database cache in WordPress.
    This is used to load up the custom post types and related fields.

    70 sounds a lot though, are you able to list all of these or provide a report from Query Monitor?

    Cheers, Jory

    Thread Starter jayhtml

    (@jayhtml)

    Not sure how to export from query monitor, below are some of the query I got from query monitor for all queries by pods.

    get_option(‘_transient_timeout_pods_pods_components-2881’)

    get_option(‘_transient_pods_pods_components-2881’)

    get_option(‘_transient_timeout_pods_8a89b940c18079b70cb5f4148c5b5942’)

    get_option(‘_transient_pods_8a89b940c18079b70cb5f4148c5b5942’)

    get_option(‘_transient_timeout_pods_f87143859c75567c7d0b3cac33c19e7e’)

    get_option(‘_transient_pods_f87143859c75567c7d0b3cac33c19e7e’)

    get_option(‘_transient_timeout_pods_3c9cfc601320041bf4b54a8135679372’)

    get_option(‘_transient_pods_3c9cfc601320041bf4b54a8135679372’)

    get_option(‘_transient_timeout_pods_4d6c5b1c697473b792e0500b11ef9c22’)

    get_option(‘_transient_pods_4d6c5b1c697473b792e0500b11ef9c22’)

    get_option(‘_transient_timeout_pods_d52ec8ca2f6405b876168ef31b7720cf’)

    get_option(‘_transient_pods_d52ec8ca2f6405b876168ef31b7720cf’)

    get_option(‘_transient_timeout_pods_9f43aca1b8636fa7b1db57c4cab3bbde’)

    get_option(‘_transient_pods_9f43aca1b8636fa7b1db57c4cab3bbde’)

    get_option(‘_transient_timeout_pods_62e0214b1daa6a248d17b3fcfea970d8’)

    get_option(‘_transient_pods_62e0214b1daa6a248d17b3fcfea970d8’)

    get_option(‘_transient_timeout_pods_pods_core_loader_objects-2881’)

    get_option(‘_transient_pods_pods_core_loader_objects-2881’)

    get_option(‘_transient_timeout_pods_pods_wp_cpt_ct-2881’)

    get_option(‘_transient_timeout_pods_b504288ea987809a1b55d4a7f893a1a7’)

    get_option(‘_transient_pods_b504288ea987809a1b55d4a7f893a1a7’)

    get_option(‘_transient_pods_4ee2086ef1bed493b4713b81d2ab3853’)

    get_option(‘_transient_pods_3e3bae1f502795ec7034b8b72514caa2’)

    et_option(‘_transient_timeout_pods__pods_pfat_auto_pods-2881’)

    Plugin Author Scott Kingsley Clark

    (@sc0ttkclark)

    Are you using an object cache or Pods Alternative Cache? Those generally reduce transient queries.

    Transients are normally utilized by Pods (and ACF) to reduce overall queries on a page by storing data that changes less often already in a packaged state so it can save resources/time.

    Thread Starter jayhtml

    (@jayhtml)

    Thank you so much @sc0ttkclark

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.