I am working in a project where I have millions of records in a SQL table. Table schema could be for example:
Site Id varchar Primary Key
Site Name varchar
Site Url varchar
Owner varchar
Details varchar
...
Now the scenario is to provide search on Site name and Site Url on UX. For example say here are the sites displayed on UX:
**Site Name Site Url Site Owner**
NishantBlog1 https://baseurl.com/nisblog1 Nishant Saxena
NishantBlog2 https://baseurl.com/nisblog2 Nishant Saxena
RamBlog3 https://baseurl.com/nisblog3 Nishant Saxena
Now say somebody searches for "is" then we need to give all the above three sites as every URL contains "is".
We can of course support it using LIKE %is%
in this example but it won't be that much efficient as it will use index scan instead of index seek for obvious reasons even if create index on URL. Is there a way to improve the performance?
I search around it and found SQL Full Text index but it won't work in our scenario as it could work in nisblog3
type of search but not for "is" as there is no separator here.
Please note that I have also looked at SQL materialized path but I can't go with it even if it helps with performance (did not test) as it is going to increase the size of the table exponentially. Please correct me if I am wrong.
Because of large size and other issues I can't have a in memory trie and note that elastic search is not an option for us.
Let me know what is the best thing I can do here. The web service is written in C# and I can use storage procs too.