![]() |
Improve performance on thread view updating
Per Doc Erwin:
http://www.vbulletin.com/forum/showp...8&postcount=18 I'm releasing this here. I have a suggestion to improve performance although it is for mysql 4.04 and up (I assume at some point a future version of vb will require it). Requirements: MySQL 4.04 If you have a large forum, run mysql 4.04 and up and want to try this, please report back on your results. The way updating threads views works right now, (even though putting it in cron improved things,) you are still going through many queries to the thread table, potentially locking it up while updating views.The current code from threadviews.php is: PHP Code: PHP Code:
With 4.04 you can do a multitable update. FIRST, create the table ONCE ONLY PHP Code: PHP Code:
PHP Code: PHP Code:
That will reduce the number of queries by however many threads get updated in the cron interval. Additionally, you might be able to skip creating the extra table using subqueries. I haven't gotten around to writing that code yet. If someone wants to add that,mention it in this thread and I'll update the code. |
put your codes in [ PHP ] tags please...
also, can you point a real MySQL doc where the example is explained and rated ?!... because i can see your point, as a mysql developper, but many others will discuss it... |
I copied it from vb.com and on preview the php code displayed. I edited it.
On the mysql: http://dev.mysql.com/doc/mysql/en/update.html Quote:
|
ok, no problem btw...
but i would usggest you to release it in the BETA forum instead, because it's in development, not really releaseable on production sites... but maybe you can modify it to have a if statement depending on PHP version we have on our server... |
Quote:
This hack doesn't depend on PHP version, only on MySQL version - anything greater than 4.0 works. My changes are: 1. This string has a typo, there should be a space after "FROM" PHP Code:
PHP Code:
http://www.vbulletin.com/forum/showp...4&postcount=16 |
Quote:
|
Quote:
PHP Code:
|
I encouraged dwh to post here. :) It's fine to be in this forum, no need to be in beta considering it's working on some large sites.
I may add this to my forum with over 14mil posts... I am always wary of database corruption. :) |
Quote:
You deserve a beer. Can you PM me your url? Would love to take a look. |
Erwin's forum is very large :)
I have this running on my home box with no problems, probbly use this on my production site soon to. :) |
All times are GMT. The time now is 01:36 AM. |
Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
![]() |
|
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|