This is a top 20+ MySQL tips I found on the web to maximize your querie's speed. A database is a need in BBG development this tips will help you.
http://net.tutsplus.com/tutorials/other ... practices/
And the same one but in spanish if you prefer:
http://boozox.net/mysql/20-consejos-par ... -conocias/
Salu2!
Top 20+ MySQL Best Practices
- Jackolantern
- Posts: 10891
- Joined: Wed Jul 01, 2009 11:00 pm
Re: Top 20+ MySQL Best Practices
With the tip on drawing random entries from the database, does that work if you have deleted entries in the database?
I tend to use rand() and I'm thinking I might try and atleast switch to a lower load practice. But on the other hand I'll want to delete ancient registrations, at some point?
Edit: Yeah, I meant this code
It looks like it might be alright?
I tend to use rand() and I'm thinking I might try and atleast switch to a lower load practice. But on the other hand I'll want to delete ancient registrations, at some point?
Edit: Yeah, I meant this code
Code: Select all
$r = mysql_query("SELECT count(*) FROM user");
$d = mysql_fetch_row($r);
$rand = mt_rand(0,$d[0] - 1);
$r = mysql_query("SELECT username FROM user LIMIT $rand, 1");