Hi Folks, facts: i have a statistic-database for a php/mysql content-monitoring program. the problem: the tables have many entries, and so i need to optimize all my queries, which join many tables to one result. i tried any solution, but i only got minimal here is one query:
SELECT content.mem_id FROM ca0_stats stats, ca0_contracts contract, ca0_content content WHERE stats.stats_contract=contract.contract_id AND contract.content_id=content.content_id AND DATE_FORMAT(FROM_UNIXTIME(stats.stats_time),'%Y-%m-%d')=DATE_FORMAT(NOW( ),'%Y-%m-%d') GROUP BY content.mem_id EXPLAIN: table type possible_keys key key_len ref rows Extra stats ALL stats_contract NULL NULL NULL 290180 where used; Using temporary contract eq_ref PRIMARY,content_id PRIMARY 2 stats.stats_contract 1 content eq_ref PRIMARY PRIMARY 2 contract.content_id 1 i tried to optimize with left join, but i think i did it wrong. the ca0_stats table is the biggest, with over 300.000 entries. thanx a lot for every hint. harald --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php