[2.1] Upgrader - Performance#9272
Conversation
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
Signed-off-by: Shawn Bulen <bulens@pacbell.net>
|
Some before & after comparisons... I've always understood that MyISAM is faster than InnoDB. However, in my initial upgrader tests, InnoDB was faster, due to the table copy efficiencies. So it depends on the activity. MariaDB 11.5.2. MySQL 8.4.4. Before - 2.0.19 => 2.1.7, with #9271 only:
Note that without the json fix #9271, Maria DB cannot complete with this dataset. After - 2.0.19 => 2.1.7, with #9270, #9271, #9272:
It's pretty shocking how quick MyISAM can be if you sidestep the table restructures w/fulltext. |
|
I like the changes, but I am worried about these in the stable release. @Sesquipedalian, what are your thoughts on this? |
|
This doesn't affect the patch though.
…On Sat, Jun 20, 2026 at 5:01 AM Jeremy D ***@***.***> wrote:
*jdarwood007* left a comment (SimpleMachines/SMF#9272)
<#9272 (comment)>
I like the changes, but I am worried about these in the stable release.
@Sesquipedalian <https://github.com/Sesquipedalian>, what are your
thoughts on this?
—
Reply to this email directly, view it on GitHub
<#9272?email_source=notifications&email_token=AADJNNYKIRV5ZVR2CJSYQLL5AZ4IZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZVG43DONBSGU4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSWGM33PORSXEX3DNRUWG2Y#issuecomment-4757674258>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AADJNNZYWVYFTTQOOGNN2GD5AZ4IZAVCNFSNUABDKJSXA33TNF2G64TZHMZTENJXGQ3TKO2JONZXKZJ3GQ3DQNZYGMZDKNBSUF3AE>
.
Triage notifications, keep track of coding agent tasks and review pull
requests on the go with GitHub Mobile for iOS
<https://github.com/notifications/mobile/ios/AADJNN4DHZM2OGHAMOQ2ZLT5AZ4IZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZVG43DONBSGU4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSVGM33PORSXEX3JN5ZQ>
and Android
<https://github.com/notifications/mobile/android/AADJNN6I6VN465E72N76OS35AZ4IZA5CNFSNUABFM5UWIORPF5TWS5BNNB2WEL2JONZXKZKDN5WW2ZLOOQXTINZVG43DONBSGU4KM4TFMFZW63VKON2WE43DOJUWEZLEUVSXMZLOOSXGM33PORSXEX3BNZSHE33JMQ>.
Download it today!
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
|
i'm worried we are changing the upgrader in a way that we can't be certain we didn't introduce a breaking upgrade bug that can be caught in the limited testing that occurs during a patch. Not the actual patch file itself. |


See #9259 for other issues with large DB upgrades
The upgrader has several extremely expensive database operations, all to the messages table:
For each of the above operations, under the covers, ALTER TABLE makes a copy of the table then rebuilds it from scratch.
It doesn't makes sense for it to take many hours to do a simple operation, even on 3.3M messages... ALTER TABLE clearly has issues with these implicit table rebuilds; it is much faster to rebuild the table explicitly yourself.
MariaDB handles this much better than MySQL, I believe due to a better implementation of ALGORITHM=INPLACE & ALGORITHM=INSTANT. MySQL has more constraints on these timesavers. HOWEVER... If you restructure the activity a bit, to account for such constraints (e.g., only dropping columns at the end of the column list) MySQL is almost as quick as MariaDB.
This PR:
The IPv6 & UTF8 conversions remain time-consuming. No way around that.
Still, the time savings are significant. My "before" executions on MySQL were in the ~60 hour range, and varied on a number of factors, e.g., InnoDB vs MyISAM & environment/debug settings. MariaDB "before" executions varied from 5-18 hours. Tests were 2.0 => 2.1 upgrades, DB has 3.3M rows, no attachments.
With this change, MySQL now takes ~1 hour, & MariaDB takes ~45 mins.
If necessary, we could do the same to members. I've never seen members updates go near as long though.
I'm still doing tests on this.
If approved, I'll work on the 3.0 version.