简体   繁体   中英

Linq to sql Query running very slowly in Asp.net mvc web application

Net MVC Web application in that i have search functionality, the searched result i will filter using states, cities etc. i have done this filtering but my when search for a string it was taking time more than 40 secs even when i use filters also its taking more time. my database tables more than 1.5 millions of records, so what i have to do for fast search result. this is my code

IQueryable<ListCompanyViewModel> Companies = (from cindata in _db.MCA_Datas
                             join masdata in _db.CompanyMasterDatas on cindata.CORPORATE_IDENTIFICATION_NUMBER equals masdata.CIN_LLPIN_FCRN
                             where cindata.COMPANY_NAME.Contains(searchString)
                             && masdata.Company_LLP_Status == "Active"
                             select new ListCompanyViewModel
                             {
                                 CompanyName = cindata.COMPANY_NAME,
                                 CIN_No = masdata.CIN_LLPIN_FCRN,
                                 Status = masdata.Company_LLP_Status,
                                 IndustryType = cindata.PRINCIPAL_BUSINESS_ACTIVITY_AS_PER_CIN,
                                 Authorised_Capital = masdata.Authorised_Capital,
                                 ROC_Code = masdata.ROC_Code,
                                 Class_of_Company = masdata.Class_of_Company
                             });

with this Reference link i have created my search function. so i have implemented in my application ajax.BeginForm method for search and filtering also. so please help me how could i perform search very fast.

尝试在cindata.COMPANY_NAME上建立非聚集索引

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM