Quantcast
Channel: Go4Expert
Viewing all articles
Browse latest Browse all 1987

How to Tune SQL Statement with IN List Bind Variables for MySQL?

$
0
0
The following is an example shows a SQL statement with a variable on the IN List operator. The SQL retrieve records from EMPLOYEE table that (EMP_ID,@1) should match any value in a set of values on the right-hand side.

select * from employee
where (emp_id,@1) in ((1000000,'a'),(2000000,'b'),(3000000,'c'))

Here the following are the query plans in Tosska proprietary tree format, it takes 19 seconds to finish.
[​IMG]
The...

How to Tune SQL Statement with IN List Bind Variables for MySQL?

Viewing all articles
Browse latest Browse all 1987

Trending Articles