To The Point
If you need to search for:
- Leading wildcards
- Substrings
- Charindexes
- Patindexes
- Replaces
- Lefts
- Rights
- Concats
- Any combination of TRIMs
- Columns with prefixed values
- Columns with suffixed values
- Concatenated columns
- String split columns
Something is broken in the way that you store data.
You’re overloading things, and you’re going to hit big performance problems when your database grows past puberty.
Thanks for reading!
Going Further
If this is the kind of SQL Server stuff you love learning about, you’ll love my training. I’m offering a 75% discount to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that and need to solve performance problems quickly.
Related Posts
- The How To Write SQL Server Queries Correctly Cheat Sheet: Views And Common Table Expressions Are The Same Thing
- A Little About PAGEIOLATCH Waits In SQL Server
- sp_PressureDetector: Now With PerfMon Counters And Server Sampling
- Join me In Boston May 10 For A Full Day Of SQL Server Performance Tuning Training
Hi Erik!
Based on your experience, what would you recommend for someone that’s trying to deal with those nasty leading wildcards, besides wine and whiskey? Trigrams? Full-Text? or something out of SQL Server like Elastic Search?
Thanks!
I’d much rather people aim for properly normalized schema first, but…
* Trigrams can be a bear to maintain (I’ve seen the articles)
* Full text search sucks
* Elasticsearch can be worthwhile if developers are savvy enough
Thanks!