So, I was running some queries, joining between sbds_tx_comments
and sbds_tx_votes
and found that there was no index on permlink
in the sbds_tx_votes
table so my join was pretty slow.
First of all, adding an index to a 46GB table is basically impossible so I just created a new duplicate table with no data and added an index on that field, then inserted a few thousand records to compare the performance against the primary table. The difference was significant.
So, now I'm carefully re-inserting the entire sbds_tx_votes
into my new sbds_tx_votes_copy
table with the additional index.
I stopped SBDS to avoid new writes while this is running, and I have a new table now too! So, it'll probably be a day or two before I'm back up to the head_block again, and my numbers might be a little different now with the index, but I'll post an update when that's back up.
And I think I might throw in an ALTER TABLE sbds_tx_votes ADD INDEX...
in my script so this is implemented at the start.