Reputation: 1595
I am wondering if it makes a sense to put into sort key column the used for searches with like SQL operator: '%something%'.
Upvotes: 0
Views: 458
Reputation: 4208
It does not because even with the sort key set it has to scan all rows to find something in the middle. The only case where sort key helps is the statement with wildcard at the end: `like 'something%', this way the engine will look only at the blocks where values start with 's' or something like that. Also it has to be the first column of the sortkey.
Upvotes: 1