Currently the log query function in the project because of the perennial write, has reached tens, the log is like query, the speed is conceivable.
Only the optimizations in the database are discussed here.
At that time, thought of two scenarios, one is partition, and the other is full-text search.
Partition, if the cross-region, the speed will be very slow, and the granularity of the area is also considered, and since the use of like '%xx% ', it is inevitable that the index will not go.
So choose SQL Server's Full-text search feature, which is similar to a lightweight search engine.
Implementation steps:
1. When installing SQL Server first, you must select the Install Full-text search feature
2. Create a full-text catalog, right-click Create,
3. Define the full-text index on the corresponding table or view: Note that the table or view must have a unique index, and the view cannot contain union, and each table or view can have only one full-text index, step: Selecttable or view--right--Define full-text indexing-next, until the index interface is selected, if there is a full-text index, the system is selected by default, otherwise, no valid index is indicated. 4. Select the index column, 3rd OK, click Next, select the column you want to build the full-text search, and select the word breaker language (similar to the word, search engine)5. After the 4th step OK, the following is the set index fill rule, the above are explained, their actual operation to look at the line, and then the next step, until the definition of the Fill plan this page, this what to do. That means I can define a job timing to fill and fill the way (it can't be fully populated every time, can be an incremental population or a change-based fill,), next. 6 Modify query Sql:cl like '%xxx% ' to contains (cl, ' xxx '), you can also use FREETEXT. The rest of your own Google bar
SQL Server Full-text search uses