Jamez Posted February 22, 2006 Posted February 22, 2006 Hi, There are 3 very similar queries in our store that im sure can be made into one with a JOIN although im not sure how to implement it. [3] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1 [4] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1 [5] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1 These are the 3 queries from Chemo`s Page Cache contribution. Any help making this into 1 query would be great! Thanks in advance.
Jamez Posted February 22, 2006 Author Posted February 22, 2006 Am I right in thinking this query can be reduced to 1 using a JOIN?
kgt Posted February 22, 2006 Posted February 22, 2006 Hi,There are 3 very similar queries in our store that im sure can be made into one with a JOIN although im not sure how to implement it. [3] => SELECT cache_expires FROM cache WHERE cache_id='9e18319fdade9c4245b75b9845486bb8' AND cache_language_id='1' LIMIT 1 [4] => SELECT cache_expires FROM cache WHERE cache_id='dae46d252d93631f218b79dd62eb04eb' AND cache_language_id='1' LIMIT 1 [5] => SELECT cache_expires FROM cache WHERE cache_id='f47315cba5e35ca49994fbf925cfaa75' AND cache_language_id='1' LIMIT 1 These are the 3 queries from Chemo`s Page Cache contribution. Any help making this into 1 query would be great! Thanks in advance. They can be made into one, but a join is completely unnecessary. However, I wonder if this will continue to work as you expect when you combine the queries. SELECT cache_expires FROM cache WHERE ( cache_id='9e18319fdade9c4245b75b9845486bb8' OR cache_id='dae46d252d93631f218b79dd62eb04eb' OR cache_id='f47315cba5e35ca49994fbf925cfaa75' ) AND cache_language_id='1' LIMIT 3 Contributions Discount Coupon Codes Donations
Jamez Posted February 22, 2006 Author Posted February 22, 2006 They can be made into one, but a join is completely unnecessary. However, I wonder if this will continue to work as you expect when you combine the queries. SELECT cache_expires FROM cache WHERE ( cache_id='9e18319fdade9c4245b75b9845486bb8' OR cache_id='dae46d252d93631f218b79dd62eb04eb' OR cache_id='f47315cba5e35ca49994fbf925cfaa75' ) AND cache_language_id='1' LIMIT 3 Interesting, I wonder why there are 3 cache files in the first place? Surely only 1 is required?
Recommended Posts
Archived
This topic is now archived and is closed to further replies.