假設我已經得到下面的SQLSQL優化:內部連接
如何優化查詢的性能?
select product, address, quantity,
price, create_date, sum(no_of_photo) as no_of_photo
from
(
SELECT customer.PROJECT_ID as project_id ,
customer.ORDER_TYPE as order_type,
customer.product_name as product,
customer.address_name as address ,
customer.quantity_name as quantity,
user.first_name || ' ' || user.last_name AS price,
customer.create_date, customer.no_of_photo
FROM customer
INNER JOIN user
ON customer.creation_userid = user.userid
) master_list
group by project_id, order_type ,
product, address, quantity, price,
create_date
having project_id = 123456
order by product, address, quantity, price, create_date
向我們展示執行計劃。 –
**再次**,爲什麼它需要優化?查詢優化器說什麼?這些表中是否有索引(如果是這樣的話,還有哪些列)? ** Think。** – 2012-09-21 10:17:40
什麼是查詢優化器? –