Not the answer you need?
Register and ask your own question!

index disabled when using variable

xiaoxiaolinxiaoxiaolin EntrantInactive User Role Beginner
Hi all :)
When using the stored procedure, I passed the cursor to the SQL and found that the SQL was unable to use the index.

You can reproduce this when using session variables,For example

Correct use index:
1.SELECT count(1) FROM T_E4S_BU_ECA_FAIL_UNCONT where FAIL_NO='H2923LFR001690' ;

Index disabled,full table scan:
2.set @FAIL_NO='H2923LFR001690' ;
SELECT count(1) FROM T_E4S_BU_ECA_FAIL_UNCONT where [email protected]_NO ;

How can i do? thx
Sign In or Register to comment.

MySQL, InnoDB, MariaDB and MongoDB are trademarks of their respective owners.
Copyright ©2005 - 2020 Percona LLC. All rights reserved.