Hi, I work at a fairly big website; we have ~400-500 million page views a month. We use PHP and MySQL.
Currently our page flow works like this (semi pseudo code for clarity):
mysql_connect();
mysql_select_db('red');
mysql_query('SELECT * FROM apples');
mysql_query('SELECT * FROM cakes');
One of my co-workers suggested that mysql_select_db
slows down page loads and increases the load of the DB server, and suggested to change our "flow" to be like:
mysql_connect();
mysql_query('SELECT * FROM red.apples');
mysql_query('SELECT * FROM red.cakes');
Is it true that it will make a difference? I'm especially concerned about the time it will take to make this change; will we see any noticeable results?
Is it worth it?