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的通配符是非常强大的。但是这种强大是建立在:比其他类型的搜索浪费更多的处理器占用上的。
在这里有一些使用通配符的建议希望大家能记住:
·尽量用其它的搜索操作,代替通配符;
·除非必须,请不要将通配符搜索放在搜索模式的最前面,将它放大最前面会使处理变得非常慢;
·小心通配符的位置,如果你放错位置的话将不会得到返回数据。
再重申一次,通配符是一个重要并有用的搜索工具,你将会非常频繁的使用它。