asmith Posted October 7, 2011 Share Posted October 7, 2011 Hello, I've been reviewing my codes/queries. I found that If I split a query (with 2 left joins) into 3 queries, the sum of the 3 queries times is actually less than the main query. While learning MySQL I always went with "Less queries, More performance", but this case made me wonder which way to choose. Is it easier for MySQL/CPU/Server to handle 3 queries that takes less time or one query taking a bit more? Thanks for your time. Link to comment https://forums.phpfreaks.com/topic/248639-time-vs-number/ Share on other sites More sharing options...
fenway Posted October 7, 2011 Share Posted October 7, 2011 Since you haven't shown us anything, it's impossible to say. Link to comment https://forums.phpfreaks.com/topic/248639-time-vs-number/#findComment-1276914 Share on other sites More sharing options...
The Little Guy Posted October 7, 2011 Share Posted October 7, 2011 it all depends on the tables, such as: - Size - Structure - and other factors Link to comment https://forums.phpfreaks.com/topic/248639-time-vs-number/#findComment-1277015 Share on other sites More sharing options...
awjudd Posted October 8, 2011 Share Posted October 8, 2011 Have you indexed your tables? Have you run EXPLAIN on your queries to see how it is actually being run through the query engine? ~juddster Link to comment https://forums.phpfreaks.com/topic/248639-time-vs-number/#findComment-1277153 Share on other sites More sharing options...
fenway Posted October 9, 2011 Share Posted October 9, 2011 And have you posted that EXPLAIN for us to review? Link to comment https://forums.phpfreaks.com/topic/248639-time-vs-number/#findComment-1277489 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.