MySQL Forums
Forum List  »  Performance

JOIN PERFORMANCE
Posted by: Adam Knight
Date: October 26, 2004 12:10AM

Can anyone tell me if there could be any significant performance difference between using these two queries:

Which should be used for best practice ?

1)
SELECT DISTINCT
suppliers.supplier_name
FROM
raw_sales, suppliers, items left join net_rates
on items.item_id=net_rates.item_id
where
raw_sales.item_num=items.item_num and
items.supplier_id=suppliers.supplier_id and
(net_rates.net_rates_amount = '0' OR net_rates.net_rates_amount IS NULL)

2)
SELECT DISTINCT
suppliers.supplier_name
FROM
suppliers
INNER JOIN
items
ON
suppliers.supplier_id = items.supplier_id
INNER JOIN
raw_sales
ON
raw_sales.item_num = item.item_num
LEFT JOIN
net_rates
ON
items.item_id = net_rates.item_id
ORDER BY supplier_name

Options: ReplyQuote


Subject
Views
Written By
Posted
JOIN PERFORMANCE
4319
October 26, 2004 12:10AM
2819
October 28, 2004 08:47AM
2571
October 30, 2004 04:34AM


Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.