Basically you need to
normalise your database, and then run as few and as efficient queries as possible. You can find out how long your queries take to run using microtime as below:
PHP Code:
$starttime=microtime();
// run query
echo ($starttime - microtime());
To help you optimise specific queries we'd need to see your DB structure and the queries you're currently using.