Tips for Using Wildcards

As you can see, SQL's wildcards are extremely powerful. But that power comes with a price: Wildcard searches typically take far longer to process than any other search types discussed previously. Here are some tips to keep in mind when using wildcards:

  • Don't overuse wildcards. If another search operator will do, use it instead.

  • When you do use wildcards, try to not use them at the beginning of the search pattern unless absolutely necessary. Search patterns that begin with wildcards are the slowest to process.

  • Pay careful attention to the placement of the wildcard symbols. If they are misplaced, you might not return the data you intended.

Having said that, wildcards are an important and useful search tool, and one that you will use frequently.

 

 

使用通配符的建議

如你所料,SQL的通配符是非常強大的。但是這種強大是建立在:比其他類型的搜索浪費更多的處理器占用上的。
在這里有一些使用通配符的建議希望大家能記住:
·盡量用其它的搜索操作,代替通配符;
·除非必須,請不要將通配符搜索放在搜索模式的最前面,將它放大最前面會使處理變得非常慢;
·小心通配符的位置,如果你放錯位置的話將不會得到返回數據。
再重申一次,通配符是一個重要并有用的搜索工具,你將會非常頻繁的使用它。