sql server - SQL Indexes and Multicolumn Database search -


i have implement search finds substring in name of user. user has firstname , lastname in 2 columns. enough where firstname '%searchtext%' or lastname '%searchtext%'

what problem want solve performance. let's expect 1000 users tops. not want search take ages. thought of indexes (those columns not change much, expect value of these columns never change). know looking both columns need multi column index.

is correct way of doing this? or better use sql full text search (please provide link)? better create view firstname , lastname concatenated , search there? or better use e.g. azure search (currently, , may last entity need search for)?

i using .net 4.6 , entityframework hosted on azure web apps.

thanks

because of leading wildcard character, index not used. time index used if wildcard either in middle or @ end of string. adding 1 index on lastname, firstname can suggestion if table wide, david browne said.

if needing search both wildcards (i.e. partial match), take @ amount of data in table. if it's few thousand rows we're talking about, table scan still fine performance wise. if we're talking 50.000 rows or more, full text index best. seems tutorial on matter: https://docs.microsoft.com/en-us/sql/relational-databases/search/get-started-with-full-text-search


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -