快速搜索人名

时间:2022-09-13 10:49:55

I was curious to know about the best quick search query that is used to retrieve a person's info. Currently, we have a database which has columns for first name, last name and salutation. The user should be allowed to search for any permutation and combination of these columns. The simple search query is taking a lot of time and thus making this quick search slow (As the query needs to scan all the rows for first name, last name and salutation). Could you please share the various fast or advanced techniques that could be used for this purpose.

我很想知道用于检索个人信息的最佳快速搜索查询。目前,我们有一个数据库,其中包含名字,姓氏和称呼的列。应允许用户搜索这些列的任何排列和组合。简单的搜索查询花费了大量时间,因此使这种快速搜索变慢(因为查询需要扫描所有行的名字,姓氏和称呼)。您能否分享一下可用于此目的的各种快速或先进技术。

3 个解决方案

#1


2  

I think Full-text search should solve your problem (Supposing the database is MS SQL Server) A quick link for your reference http://technet.microsoft.com/en-us/library/ms142571.aspx

我认为全文搜索应该可以解决您的问题(假设数据库是MS SQL Server)一个快速链接供您参考http://technet.microsoft.com/en-us/library/ms142571.aspx

I could not comment on the question because my reputation is low

我无法对这个问题发表评论,因为我的声誉很低

#2


1  

1.You can create indexes for the column which u think is going to be searched most of the time. 2.You can combine the first name+last name and keep in a view(and this view shall e updated for every insert of name),and then query through this view rather than querying through the database. You need a proper query execution plan.Check these one out for a strategic solution https://www.simple-talk.com/sql/performance/execution-plan-basics/

1.您可以为您认为将在大多数时间搜索的列创建索引。 2.您可以将名字和姓氏组合在一起并保留在视图中(此视图应针对每个名称插入进行更新),然后通过此视图进行查询,而不是通过数据库查询。您需要一个正确的查询执行计划。请检查这些计划以获得战略解决方案https://www.simple-talk.com/sql/performance/execution-plan-basics/

#3


0  

You have to create index on these 3 columns firstname,lastname and salutation so by creating index it will search the fast so for performance point of query we create index.index are very faster. for learn about speed up your query click here

你必须在这3列firstname,lastname和salutation上创建索引,所以通过创建索引它将搜索快速,因此对于查询的性能点我们创建index.index非常快。了解如何加快查询速度请点击此处

#1


2  

I think Full-text search should solve your problem (Supposing the database is MS SQL Server) A quick link for your reference http://technet.microsoft.com/en-us/library/ms142571.aspx

我认为全文搜索应该可以解决您的问题(假设数据库是MS SQL Server)一个快速链接供您参考http://technet.microsoft.com/en-us/library/ms142571.aspx

I could not comment on the question because my reputation is low

我无法对这个问题发表评论,因为我的声誉很低

#2


1  

1.You can create indexes for the column which u think is going to be searched most of the time. 2.You can combine the first name+last name and keep in a view(and this view shall e updated for every insert of name),and then query through this view rather than querying through the database. You need a proper query execution plan.Check these one out for a strategic solution https://www.simple-talk.com/sql/performance/execution-plan-basics/

1.您可以为您认为将在大多数时间搜索的列创建索引。 2.您可以将名字和姓氏组合在一起并保留在视图中(此视图应针对每个名称插入进行更新),然后通过此视图进行查询,而不是通过数据库查询。您需要一个正确的查询执行计划。请检查这些计划以获得战略解决方案https://www.simple-talk.com/sql/performance/execution-plan-basics/

#3


0  

You have to create index on these 3 columns firstname,lastname and salutation so by creating index it will search the fast so for performance point of query we create index.index are very faster. for learn about speed up your query click here

你必须在这3列firstname,lastname和salutation上创建索引,所以通过创建索引它将搜索快速,因此对于查询的性能点我们创建index.index非常快。了解如何加快查询速度请点击此处