Existing index in the wp_postmeta table on the meta_value column

WP Intense Q & ACategory: Scalability ProExisting index in the wp_postmeta table on the meta_value column
Supereight asked 3 weeks ago

Hello, I recently bought scalability pro and am currently testing on my staging site.

I have a question about indexes, I already have an index on the post meta table on the meta value column that is created by another optimisation plugin "servebolt optimizer".

I would like to ask, is there any issue with this in terms of conflicting with the B-Tree indexes that Scalability pro adds? Can the two plugins co-exist? is there any need for them to co-exist?

Thanks

Sam

1 Answers
Dave Hilditch Staff answered 3 weeks ago

Hi – sorry, I actually replied immediately here:

https://discordapp.com/channels/837258064704438282/877862974897938442/893952946918805584

Yes, multiple indexes can co-exist. They are MySQL indexes. With two identical indexes, it’s wasteful of disk writes, but disk reads are as fast as they normally would be – no extra benefit.

I’ll be upgrading Scalability Pro soon to allow you to choose which of these indexes to create and to inspect the table as it currently stands to advise whether you should create an extra index.

Sam C. replied 3 weeks ago

Hi David, thanks for the quick reply. I couldn’t make that discord link work for some reason.

So I am ok to have the index created as well as those created by Scalability Pro? Or is it that Scalability pro would ad this or a similar index anyway so you are saying it is just unnecessary to have the one created by ServeBolt Optimizer on the meta value column?

Just want to be sure I understand completely, I am relatively new to SQL indexes etc.

thanks
Sam

Dave H. Staff replied 2 weeks ago

There’s no harm to having multiple indexes – I said before, there will be a minor impact on writes to postmeta and a little extra space used on the disks, but not much to notice. I’ll upgrade Scalability Pro to detect other optimisation plugins and indexes created by other plugins now that they seem to be adding indexes too!

Sam C. replied 2 weeks ago

OK great, that is good to know. I have seen a couple now that are adding indexes so that feature would be awesome. Also, your plan to add to choose which to add would be good so you could add them one by one and reduce the load on the server. Our postmeta table has 11m rows so I was really nervous about running it in case it had problems with that amount of data. It completed fine on our staging site, but would still be great to be able to break up these tasks.

We use cookies

We use cookies for various things on our site, including our on-site chat bubble (if you use it), our comment forms (if you use them) and for session handling (if you log in).

Other than that, we use cookies to identify where traffic came from to help us understand which traffic turns into sales, we use a cookie for Google Analytics traffic analysis and we use a cookie to customise adverts for our own products we think you'll be interested in.

You can read more detail in our privacy policy page. Please click 'Accept' or 'Decline' to continue.