Home sql SQL-Server - What is SARG argument?

SQL-Server – What is SARG argument?

Author

Date

Category

Good afternoon, please tell me, please, what is a SARG argument and how does the optimizer use it?


Answer 1, Authority 100%

Sarg = Seekable Argument, such an argument, when substituting which the WHERE condition allows you to use the index. For example:

select * from mytable where id = 3;

will be able to use the idling index, and:

select * from mytable where (id * 3) = 3;

No, since it will take to multiply each ID value in the table, which is equivalent to the complete coupling. Nonsarg can greatly slow down the execution of your queries, especially often such arguments are obtained as a result of a custa cable to another type.

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions