Previous Thread
Next Thread
Print Thread
Rate Thread
#249508 06/08/2003 9:13 AM
Joined: Apr 2001
Posts: 45
Power User
Power User
Offline
Joined: Apr 2001
Posts: 45
www.UtterAccess.com came to be from the site www.AThree.com, which originally used a web bbs forum, then threads 5.x.x.

Running 6.1.1, we now have >23,000 users, 210,000 posts and are noticing erratic performance with no definite conclusion as to why. I've optimized the Db and have begun a search to reduce 'weight' anywhere possible, feeling the performance issue may be being caused by the quantity of records.

I ran this query on the database via phpmyadmin:
Code
<br />SELECT w3t_Last. *<br />FROM w3t_Last LEFT JOIN w3t_Users<br />ON w3t_Last.L_Username = w3t_Users.U_Username<br />WHERE ( ( ( w3t_Users.U_Username ) IS  NULL  ) )<br />


which returns >900 orphaned (useless) records in the w3t_Last table. They probably exist due to the conversions.

I'm fairly savvy with databases, but not so with mySQL. Other than sitting here and knocking out the records 1 by 1, does anyone know what the query would be to toss these in one shot?

Any other performance enhancements anyone can think of would be appreciated. We were using mySQL 4 but down graded to 3 to see if it would help (no. )

Thanks all,

Gord

Sponsored Links
med2004 #249509 06/09/2003 3:47 AM
Joined: Apr 2003
Posts: 10
Newbie
Newbie
Offline
Joined: Apr 2003
Posts: 10
> Other than sitting here and knocking out the records 1 by 1,
> does anyone know what the query would be to toss these in
> one shot
Write a little script doing this ;-)
MySQL does currently not support join or subselects in delete-statements.
But if you hold your result and kick the records out using the primary key it should work.

> We were using mySQL 4 but down graded to 3 to see if it
> would help
Of course MySQL 3 is much slower than MySQL 4!
What says your SHOW STATUS and what are the values in your
my.cnf?

So long...

Indy

Joined: Apr 2001
Posts: 45
Power User
Power User
Offline
Joined: Apr 2001
Posts: 45
Well, Not such a big difference with mySQL 3 and 4 speed - at least in my case. This was only applied as it was advised on the WHM CPanel news in the event any mySQL issues were being encountered.

Here's a solution that I've applied and I haven't heard any complaints yet...

Run a delete query to remove all w3t_Last records older than say, 1 year. First off, if you have thousands of posts as I do, a member who comes back after 1 year of absence ends up with such a horrific number of un-reads, they'll probably just hit the 'mark all read' anyway.

This tossed around 26,000 records from the bloated table and immediately improved the speed. I might even move that up to 6 months to see the reaction.

Ultimately, re-running my original query returned 1 record. That I could handle with a manual delete.

Thank you,

Gord

med2004 #249511 06/10/2003 9:34 AM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
Wow. I had about 12000 entries from before this year which I removed and it was a significant speed boost to my board. Thanks for that tip!

c0bra #249512 06/10/2003 11:05 AM
Joined: Apr 2001
Posts: 45
Power User
Power User
Offline
Joined: Apr 2001
Posts: 45
Anytime - my pleasure.

I've also just noticed that the records included are showing User versus all forums?! This is not logical. Should be User versus the forums they're entitled to see. With 40+ forums X 23,000 members ... well, that's a stack of records to read so frequently.

Rick? Perhaps a little query work could set this so only the Users viewable forums are logged? Let's see... I have about 5 forums which are privilege only, so that's 5 x say, 22,500 which could be removed ...yep. Helluva savings for space and query time.

Opinions anyone?

Thanks again,

Gord

Sponsored Links
med2004 #249513 06/10/2003 12:06 PM
Joined: May 1999
Posts: 1,715
Addict
Addict
Joined: May 1999
Posts: 1,715
There is a variable called $Viewable in the query which limits the query to only the forums which the user is allowed to see. It is used on all forum queries to make sure that they won't see any forums that they are not supposed to.

c0bra #249514 06/11/2003 8:33 AM
Joined: Apr 2001
Posts: 45
Power User
Power User
Offline
Joined: Apr 2001
Posts: 45
Well, I went even further yesterday and reduced the 'sweep' to anything older than 3 months (another 8,000 or so). Still no complaints and certainly not as dramatic a feeling as the first one, but satisfying none the less. No noticible change in speed to my eyes.

Perhaps this should be written in as a Cron task along the lines of Expire threads and subscriptions?

Also, back using mySQL 4 with thanks to www.Bravidio.com for undo-ing and re-doing ...trying what ever it takes to make things better. I'll report in if there's any noticible increase or decrease.

Gord

med2004 #249515 02/19/2004 9:28 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
Why does w3t_Last keep more than 1 entry per forum?

domain123 #249516 02/19/2004 10:41 AM
Joined: Mar 2000
Posts: 21,079
Likes: 3
I type Like navaho
I type Like navaho
Joined: Mar 2000
Posts: 21,079
Likes: 3
and what is the query you ran to remove those older than say six months?


- Allen wavey
- What Drives You?
Joined: Nov 2000
Posts: 210
Member
Member
Offline
Joined: Nov 2000
Posts: 210
I use the doexpire cron job I think you can set forums up to expire threads after so much time already?

Sponsored Links
Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
It shouldn't have more than one entry FOR EACH USER per forum.

If so - see the "anyone running 6.4" in the announcement forum here. If there were duplicates, then your indexes probably aren't right.

This table keeps track of that last time each user has visited a forum.

So if you have 20 forums, you can conceivable have 20 entries for each user.

Daine #249519 02/20/2004 4:48 AM
Joined: May 2001
Posts: 550
Code Monkey
Code Monkey
Offline
Joined: May 2001
Posts: 550
>This table keeps track of that last time each user has visited a forum.

ic....just what would happen if one would empty it completely?

Joined: Nov 2001
Posts: 10,369
I type Like navaho
I type Like navaho
Joined: Nov 2001
Posts: 10,369
Everyone would have every post unread -

so that's OK to do - just tell everyone to use the mark all read feature and set everything read to start fresh.


Link Copied to Clipboard
Donate Today!
Donate via PayPal

Donate to UBBDev today to help aid in Operational, Server and Script Maintenance, and Development costs.

Please also see our parent organization VNC Web Services if you're in the need of a new UBB.threads Install or Upgrade, Site/Server Migrations, or Security and Coding Services.
Recommended Hosts
We have personally worked with and recommend the following Web Hosts:
Stable Host
bluehost
InterServer
Visit us on Facebook
Member Spotlight
hatter
hatter
USA
Posts: 69
Joined: January 2001
Forum Statistics
Forums63
Topics37,573
Posts293,925
Members13,849
Most Online5,166
Sep 15th, 2019
Today's Statistics
Currently Online
Topics Created
Posts Made
Users Online
Birthdays
Top Posters
AllenAyres 21,079
JoshPet 10,369
LK 7,394
Lord Dexter 6,708
Gizmo 5,833
Greg Hard 4,625
Top Posters(30 Days)
Top Likes Received
isaac 82
Gizmo 20
Brett 7
WebGuy 2
Morgan 2
Top Likes Received (30 Days)
None yet
The UBB.Developers Network (UBB.Dev/Threads.Dev) is ©2000-2024 VNC Web Services

 
Powered by UBB.threads™ PHP Forum Software 8.0.0
(Preview build 20221218)