Navigation
This is archived content. Visit our new forum.

Tagged: 

  • Author
    Posts
  • #1267761

    fullboost88
    Participant

    I’m not sure if this is appropriate of the X theme forum, but is there an issue with posting a large (500) image gallery?

    I’m finding that when I try and publish a post with a large gallery my SQL is falling over.
    When I try to load the page it seems to run through and query each individual image as an sql query i.e

    SELECT post_id FROM wp_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘2016/11/sema_161104_342.jpg’
    SELECT post_id FROM wp_postmeta WHERE meta_key = ‘_wp_attached_file’ AND meta_value = ‘2016/11/sema_161104_402.jpg’

    Not sure why it would want to do that but if you have a few people visit the site, say 10, thats 10x 500 query’s, so 5000 querys. The query probably does something silly like a full table scan which causes even more issues.

    Has anyone encountered something similar?

    Thanks

    #1267877

    Paul R
    Moderator

    Hi,

    Can you provide us your site url so we can take a closer look.

    Thanks

    #1269955

    fullboost88
    Participant
    This reply has been marked as private.
    #1270116

    Rue Nel
    Moderator

    Hello There,

    Thanks for providing us the information. Where can we find the page with a gallery of 500 images? I would suggest that you use a page gallery which would display at least 24 items per page. Hoping we can limit the query per page. And then maybe you can do something for the performance of the site like caching so that the site cache version will be served to the user and avoid having to do a query every time a user visits the page. For more details about performance, perhaps this page could help: https://community.theme.co/kb/performance/

    Hope this helps.

    #1272643

    fullboost88
    Participant

    We haven’t got the 500 image post available as it was crashing the SQL service.

    Here is an example of an image gallery if that helps.

    http://www.fullboost.com.au/fb/index.php/2016/06/13/city-ipswich-winternationals-day-3/

    Thanks

    #1272684

    Lely
    Moderator

    Hi There,

    That’s too much images on a page. Please use caching to improve site performance.
    I also found a parser blocking issue on your pages. Please check this link:https://developers.google.com/web/updates/2016/08/removing-document-write

    Hope this helps.

    #1272692

    fullboost88
    Participant

    Thanks

    So even if we run a 100 image gallery, does it still query for each image?

    #1272722

    Lely
    Moderator

    Hi There,

    Yes, but there is a work around for that which is paging. Your gallery will be divided into pages thus will limit the query needed.
    You might also check the following links:
    https://css-tricks.com/finding-and-fixing-slow-wordpress-database-queries/
    https://codex.wordpress.org/High_Traffic_Tips_For_WordPress