Support » Plugin: Image Source Control » wp_postmeta entries

  • Resolved check2020de

    (@check2020de)


    ISC is amazing and the most usefull plugins since GDPR!!! It works perfekt!

    i just went trough my DB to optimize the performance and saw that there are 3931 entries with “isc” in the wp_postmeta table.

    Don’t understand why there are so many entries. Is there an entry for every image format?

    is there any way to reduce the amount of entries here?

Viewing 10 replies - 1 through 10 (of 10 total)
  • Plugin Author Thomas M

    (@webzunft)

    Hi check2020de,

    thanks for reaching out.

    Up to three post meta entries are created for each image (which are technically also “posts”) to store the source and additional information given for an image.

    There is also one entry per post or page on your site to store which images are attached to it.

    Empty entries are signaling the plugin that it does not need to perform some index option.

    So the number of post meta entries in the database depends on the number of posts and images.

    > is there any way to reduce the number of entries here?

    Probably, though it would need some larger testing and rewriting due to the reasons I mention above. MySQL queries are quite efficient and I used that logic on a cached site with over 40 Mio page impressions per month without concerns for performance. However, if you can measure an impact of these entries and suggest changes then I am happy to take a look.

    Thanks,
    Thomas

    check2020de

    (@check2020de)

    Thanks for getting back that quick Thomas.

    I’m not a technical person at all… Just came to the point that I need to clean up some database tables. This took several hours. But overall I do see an impact on loading performance, especially if there is a huge distance between client and server.

    Think it is no question in general that reducing database size helps.

    Currently I have arround 750 images in WordPress which would be UP TO 2250 entries in wp_postmeta… but up to means in everage less. I have 3931, so far to much, should have 50% of them.

    So the questions are two things:

    1. Why do I have 2x times of entries?
    2. Who can the number oof entries needed reduced in future?

    Many entries (arround 700) have a meta_id, a post_id, a meta_key isc_image_posts and an EMPTY meta_value. Think this is maybe one point to work on. Are empty entries needed or should they first generated if an entry will be made (instead of generating an entry the second an image is uploaded). Empty entries signaling the plugin that it does not need to performe some index options… so the trigger to do no index is an empty entry. Maybe the trigger can be that an entry does not exist?

    There are 3 entries for each post ID, so 1 post ID and 3 meta ID. Again I’m not an IT person, but is it maybe possible to combine everything in one meta ID?

    check2020de

    (@check2020de)

    Think an improvement could be interesting for sites with no CDN, an huge amount of images and medium to high volume of traffic.

    check2020de

    (@check2020de)

    Just have had a look at the number of entries per post_id

    Most have: isc_image_souce, isc_image_source_url and isc_image_source_own
    …but some have also isc_image_post two times with different meta_value

    So at some I have 5 entries for one post_id.

    I don’t know how tto do an SQL query to show all post_is with 4 entries. This query I could run for also 5, 6,… entries. Maybe you can help me with the query?

    check2020de

    (@check2020de)

    Looks like combining meta_id with same post_id is a huge topic on Google and there are different approaches available 🙂 ….but this is by far to much tecchical for me 🙁

    Plugin Author Thomas M

    (@webzunft)

    Hi check2020de,

    > Why do I have 2x times of entries?

    This is a very general question. From your previous message, it sounds like you identified the ISC fields.

    > Who can the number oof entries needed reduced in future?

    Who or How? I am happy about suggestions with specific pointers at the code and pull requests in the github repository.

    Some keys are needed to look for specific entries. It would need more performance to hide them in a serialized array. E.g., I can now query all images without a source. If I wouldn’t have the post meta field available, I would have to query each attachment in the whole database and run another query to get its details.

    > Think an improvement could be interesting for sites with no CDN

    I am not sure I understand. ISC does not integrate with any CDN.

    > Looks like combining meta_id with same post_id is a huge topic on Google and there are different approaches available

    Exactly. We could both find at least one good article for each standpoint 🙂

    In the current version of ISC there is one bug that I already fixed in version 2.0. It caused the isc_post_images meta key to be stored with attachments, though it should only be stored with posts and pages. I am not sure anymore if the same is true with the isc_image_posts meta key being stored with posts.

    When running the beta of 2.0. You should be able to safely delete any of these keys that have the value a:0:{}. They should then only be created if needed.

    You wrote that you are not technical so I’d suggest asking someone who is for help. I don’t feel comfortable sharing SQL queries that could break something in a public forum.

    Thanks for understanding.

    Thomas

    check2020de

    (@check2020de)

    🙂 HOW 🙂

    check2020de

    (@check2020de)

    Github? As I told… even this here is normaly far above my technical know how. For Github others are needed.

    > I am not sure I understand. ISC does not integrate with any CDN.

    Sure! But if you have no CDN everything is loaded directly from your server and with all the DB queries (it is not cached)… and if the DB is slow in generall this has an effect on your website load time.

    The point with the beta version sounds interesting

    Thought the SQL query would help you to understand why there are 4, 5, 6 entries for one post_id for the future changes to reduce the entries in postmeta.
    I try to help as much as possible, but I’m not a developer and can’t help you to optimize your plugin… sorry

    Sven

    check2020de

    (@check2020de)

    Where do I get the 2.0 beta?
    When will the final 2.0 be finished?

    Plugin Author Thomas M

    (@webzunft)

    Hi Sven,

    > and if the DB is slow in generall this has an effect on your website load time

    I think you might want to look into website caching so that no queries hit the server at all.

    > Thought the SQL query would help you to understand why there are 4, 5, 6 entries for one post_id for the future changes to reduce the entries in postmeta. I try to help as much as possible

    Thank you. Much appreciated! Be assured that I looked into it before posting my replies.

    > Where do I get the 2.0 beta?

    Through the github repository (no login needed). Just click on the green “Code” button to “Download ZIP” and then install that version of ISC.

    > When will the final 2.0 be finished?

    I am through with the changes I had in mind. I have a lot going on in my day job right now and don’t want to publish it when I am cannot react quickly. So I am using the time now to get the beta out and feedback from users.

    If you test it and find an issue then it would indeed help me if you posted it under issues in github. You don’t need to be a coder for that. The conversation can be as casual there as we do it here.

    Thanks,
    Thomas

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