SQL efficiency - [=] vs [in] vs [like] vs [matches]

后端 未结 4 2148
不知归路
不知归路 2021-02-19 09:11

Just out of curiosity, I was wondering if there are any speed/efficiency differences in using [=] versus [in] versus [like] versus [

4条回答
  •  北海茫月
    2021-02-19 09:49

    The best practice for any question about what would be faster, is to measure. SQL engines are notoriously difficult to predict. You can look at the output of EXPLAIN PLAN to get a sense of it, but in the end, only measuring the performance on real data will tell you what you need to know.

    In theory, a SQL engine could implement all three of these exactly the same, but they may not.

提交回复
热议问题