Top 20+ MySQL Best Practices

C++, C#, Java, PHP, ect...
Post Reply
User avatar
Ark
Posts: 427
Joined: Wed Jun 01, 2011 10:25 pm

Top 20+ MySQL Best Practices

Post by Ark »

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!
Orgullo Catracho
User avatar
Jackolantern
Posts: 10891
Joined: Wed Jul 01, 2009 11:00 pm

Re: Top 20+ MySQL Best Practices

Post by Jackolantern »

Very good stuff in there! Nice find :)
The indelible lord of tl;dr
User avatar
Ark
Posts: 427
Joined: Wed Jun 01, 2011 10:25 pm

Re: Top 20+ MySQL Best Practices

Post by Ark »

;) Thanks!

Hope it can be helpful.
Orgullo Catracho
User avatar
Callan S.
Posts: 2042
Joined: Sun Jan 24, 2010 5:43 am

Re: Top 20+ MySQL Best Practices

Post by Callan S. »

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

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"); 
It looks like it might be alright?
Post Reply

Return to “Coding”