Large query number
This topic contains 7 replies, has 3 voices, and was last updated by Mitch Canton 7 years ago.
We have moved to a support ticketing system and our forums are now closed.
Open Support TicketTagged: queries
-
AuthorPosts
-
June 18, 2018 at 7:50 pm #435384
Hello,
I really wanted a simple sidebar layout of selected WPGD listings, that I could place on selected pages, so I created something like this:
<div class=”list-title”>Accounting and CPA</div>
[gd_listings layout=”1″ listing_width=”100″ post_number=”10″ category=”3753″ post_author=”23″ list_sort=”az” character_count=”0″]
<div class=”list-title”>Attorney and Legal</div>
[gd_listings layout=”1″ listing_width=”100″ post_number=”10″ category=”3756″ post_author=”23″ list_sort=”az” character_count=”0″]
<div class=”list-title”>Automotive</div> …..and so on, for all of the categories (by ID). And I used ‘post_author’ as a filter that defined whether the listing would show in the widget.
But this creates a bunch of queries on the pages where the widget is displayed. Like 170-200 queries. That seems like a really big number.
Is there a better way to accomplish the same thing without the potential resources hit?
Thanks.
June 18, 2018 at 7:54 pm #435386This reply has been marked as private.June 19, 2018 at 9:36 am #435451That could be normal, it depends on a few things, if you provide wp-admin i’ll check things over.
Thanks,
Stiofan
June 19, 2018 at 7:05 pm #435550This reply has been marked as private.June 20, 2018 at 9:58 am #435643I can’t tell where you have the shortcodes, i don’t see them in the widget area but the GD queries time is far behind the events plugin queries u have installed, the take 10x more time that our ones. If you want that many shortcodes there then there will be lots of queries but in this case its not taking much time. I see the main slow queries from the events plugin u have installed.
Stiofan
June 20, 2018 at 3:05 pm #435686I use the same shortcode in a couple of places, so I have it in a widget in: Appearance > Widgets > Widget Shortcode > Custom HTML: Featured Community Listings
Yes, there are definitely slow query issues with the event plugin, but that is a separate matter (and I now selectively load that plugin only on events related pages).
My question here was specifically about the total number of WPGD queries generated, and if there was a better, more efficient way to accomplish the same output display.
On an event CPT, WPGD produces 177 queries (.058 time), on a WP post, WPGD produces 198 queries (.028 time).
I know I have a lot going on there, I’m just trying to find efficiencies.
Thanks.
June 20, 2018 at 4:22 pm #435698Hi Mitch,
With that many shortcodes you will have lots of queries. V2 will shave a bit off as it uses a single option object for settings and it has some object caching for duplicate queries.
If i was u i would look for some sort of widget caching or just capture the HTML output and then put it in as html and just refresh it once a week or so, but thats only if 0.05 seconds is important to you…
Thanks,
Stiofan
June 20, 2018 at 4:32 pm #435702Thanks for taking a detailed look. I guess I’m not so worried about the .05 as I was about the sheer number of queries. I was under the (maybe mistaken?) impression that that was going to cause me some real problems as we increased our logged-in active user count.
I know the way I hacked up the widget where it includes 25+ WPGD shortcodes in the same widget was not likely normal usage, 🙂 but that was the only way I could figure out how to get the listings layout I wanted in that sidebar.
Again, I’m open to doing it another way if you had any suggestions.
-
AuthorPosts
We have moved to a support ticketing system and our forums are now closed.
Open Support Ticket