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

asp.net asp.net-mvc c#-4.0 entity-framework-6 linq-to-sql

Question

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.

1
0
12/10/2018 1:21:25 PM

Popular Answer

Try making a non-clustered index on cindata.COMPANY_NAME

0
12/10/2018 2:11:30 PM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow