MySQL Forums
Forum List  »  General

User Variable
Posted by: jongse park
Date: December 23, 2014 03:02AM

Hi,

How to tune the index for user variable?

mysql> set @a=10;
mysql> explain select col1, col2, count(col2)
from table1
where a=@a and col1='9.3'
group by col1, col2
order by col2;

How can I increase performance this query?
make index (a, col1, col2) ?
or don't pass a user variable in the where clause?
Can user variable use index ?

Please help me.

Options: ReplyQuote


Subject
Written By
Posted
User Variable
December 23, 2014 03:02AM
December 23, 2014 11:05AM


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.