Follow is the sql statement:
--------------------------------------------------------
explain SELECT ol_i_id
FROM orders, order_line
WHERE orders.o_id = order_line.ol_o_id and o_id>0
ORDER BY SUM(ol_qty)DESC
--------------------------------------------------------
Follow is the explain output:
--------------------------------------------------------
1, 'SIMPLE', 'orders', 'range', 'PRIMARY', 'PRIMARY', '4', '', 129615,
'Using where; Using index; Using temporary'
1, 'SIMPLE', 'order_line', 'ref', 'PRIMARY,order_line_ol_o_id',
'order_line_ol_o_id', '4', 'tpcw.orders.o_id', 1, ''
--------------------------------------------------------
The query plan use "Using temporary".Can i optimize this sql statement?
_________________________________________________________________
享用世界上最大的电子邮件系统― MSN Hotmail。 http://www.hotmail.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/[EMAIL PROTECTED]