| |

VerySource

 Forgot password?
 Register
Search
View: 1232|Reply: 5

select. . . IN (23,323) Will the index be used?

[Copy link]

4

Threads

7

Posts

7.00

Credits

Newbie

Rank: 1

Credits
7.00

 China

Post time: 2020-3-11 19:30:01
| Show all posts |Read mode
As the title
Reply

Use magic Report

0

Threads

28

Posts

25.00

Credits

Newbie

Rank: 1

Credits
25.00

 China

Post time: 2020-6-4 18:15:01
| Show all posts
The conditional column will be used if it has an index
Reply

Use magic Report

0

Threads

126

Posts

73.00

Credits

Newbie

Rank: 1

Credits
73.00

 China

Post time: 2020-6-4 20:15:01
| Show all posts
Will do.
Can be seen through the SQL execution plan
Reply

Use magic Report

0

Threads

88

Posts

55.00

Credits

Newbie

Rank: 1

Credits
55.00

 China

Post time: 2020-6-4 22:30:01
| Show all posts
Multiple records can be indexed by conditional column
Reply

Use magic Report

0

Threads

114

Posts

69.00

Credits

Newbie

Rank: 1

Credits
69.00

 China

Post time: 2020-6-4 23:45:01
| Show all posts
See if there is an index
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-9-1 10:45:01
| Show all posts
No, no matter whether the condition column is indexed or not, it will not be used, unless there is only one value in the parentheses after IN. Just look at the execution plan.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list