MySQL Forums
Forum List  »  Optimizer & Parser

Re: How could this SQL be optimized?
Posted by: feng guo
Date: May 30, 2014 02:46AM

Øystein Grøvlen Wrote:
-------------------------------------------------------
> Hi,
>
> I do not think these statements are equivalent.
> Are you optimizing for speed or statement
> complexity? If the former, and assuming that
> ORDERID values are unique, I suggest the
> following:
>
> SELECT
> ID,WAYBILL_NO,EXP_TYPE,PKG_QTY,EXPRESS_CONTENT_COD
> E,EFFECTIVE_TYPE_CODE
> FROM T_EXP_OP
> WHERE AUX_OP_CODE NOT IN ('NEW','UPDATE','DELETE')
> OR NOT ((OP_CODE IN (176, 162, 171, 131, 136) AND
> EXP_TYPE IN ('10', '20', '30')) OR (OP_CODE IN
> (191, 121) AND EXP_TYPE IN ('10', '20')) OR
> (OP_CODE IN (181, 111)AND EXP_TYPE = '10'));


Thanks,my origin thinking is same with yours,but that time I wasn't confident,especially after someone gives me such 'answer' above~

Options: ReplyQuote


Subject
Views
Written By
Posted
2506
May 29, 2014 11:26PM
Re: How could this SQL be optimized?
1369
May 30, 2014 02:46AM


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.