Large query number

This topic contains 7 replies, has 3 voices, and was last updated by  Mitch Canton 6 years, 9 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket

Tagged: 

  • Author
    Posts
  • #435384

    Mitch Canton
    Expired Member
    Post count: 167

    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.

    #435386

    Alex Rollin
    Moderator
    Post count: 27815
    This reply has been marked as private.
    #435451

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    That could be normal, it depends on a few things, if you provide wp-admin i’ll check things over.

    Thanks,

    Stiofan

    #435550

    Mitch Canton
    Expired Member
    Post count: 167
    This reply has been marked as private.
    #435643

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    I 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

    #435686

    Mitch Canton
    Expired Member
    Post count: 167

    I 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.

    #435698

    Stiofan O’Connor
    Site Admin
    Post count: 22956

    Hi 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

    #435702

    Mitch Canton
    Expired Member
    Post count: 167

    Thanks 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.

Viewing 8 posts - 1 through 8 (of 8 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
20% Discount Offer
Hurry! Get your 20% discount before it expires. Get 20% Discount