Hi,
I am getting two completely different performance metrics for my query in MYSQL, even though it is against same table and is expected to give slmost similar result set
If write it this way, I believe which is the right way as I am restricting the population in sub query, my query runs for ever.
SELECT d.sendermobile,dd.internalid FROM `woohoo_all_data` d
LEFT JOIN (SELECT DISTINCT mobile, internalid FROM `customer_internal_id` WHERE mobile <>'' ) dd ON d.sendermobile=dd.mobile
If I put the where clause outside, it runs with in two minutes..
SELECT d.sendermobile,dd.internalid FROM `woohoo_all_data` d
LEFT JOIN (SELECT DISTINCT mobile, internalid FROM `customer_internal_id` ) dd ON d.sendermobile=dd.mobile
WHERE mobile <>''
Can anyone tell me how different are these two queries internally to MYSQL and why is the first one runs longer.
Thanks,
Roopesh
I am getting two completely different performance metrics for my query in MYSQL, even though it is against same table and is expected to give slmost similar result set
If write it this way, I believe which is the right way as I am restricting the population in sub query, my query runs for ever.
SELECT d.sendermobile,dd.internalid FROM `woohoo_all_data` d
LEFT JOIN (SELECT DISTINCT mobile, internalid FROM `customer_internal_id` WHERE mobile <>'' ) dd ON d.sendermobile=dd.mobile
If I put the where clause outside, it runs with in two minutes..
SELECT d.sendermobile,dd.internalid FROM `woohoo_all_data` d
LEFT JOIN (SELECT DISTINCT mobile, internalid FROM `customer_internal_id` ) dd ON d.sendermobile=dd.mobile
WHERE mobile <>''
Can anyone tell me how different are these two queries internally to MYSQL and why is the first one runs longer.
Thanks,
Roopesh