Voor een zoekscherm in de applicatie waar ik mee bezig ben, kan men op verschillende criteria. NAdeel is alleen dat de where-clausule tot 8 seconden in beslag neemt, omdat er veel records in de database zitten. Ik heb op internet gezocht naar full-text searching en indexering om dit te versnellen.
Het is me nog steeds niet helemaal duidelijk wat nu het verschil is tussen beide.
Wie kan mij uitleggen wat het verschil precies is, en welke oplossing de beste keus is.
Het is me nog steeds niet helemaal duidelijk wat nu het verschil is tussen beide.
Wie kan mij uitleggen wat het verschil precies is, en welke oplossing de beste keus is.
code:
1
2
3
4
5
6
7
8
9
10
| WHERE
ISNULL(CA.CompanyCategoryId,0) = COALESCE(@intCategoryId,CA.CompanyCategoryId,0) AND
C.[Naam] LIKE '%' + @strNaam + '%' AND
(C.[Postcode] LIKE '%' + @strPostcode + '%' OR C.[BezoekPostcode] LIKE '%' + @strPostcode + '%' OR C.[FactuurPostcode] LIKE '%' + @strPostcode + '%' OR C.[OverigPostcode] LIKE '%' + @strPostcode + '%') AND
(C.[Plaats] LIKE '%' + @strPlaats + '%' OR C.[BezoekPlaats] LIKE '%' + @strPlaats + '%' OR C.[FactuurPlaats] LIKE '%' + @strPlaats + '%' OR C.[OverigPlaats] LIKE '%' + @strPlaats + '%') AND
(ISNULL(C.CountryId,0) = COALESCE(@intCountryId,C.CountryId,0) OR ISNULL(C.BezoekCountryId,0) = COALESCE(@intCountryId,C.BezoekCountryId,0) OR ISNULL(C.FactuurCountryId,0) = COALESCE(@intCountryId,C.FactuurCountryId,0) OR ISNULL(C.OverigCountryId,0) = COALESCE(@intCountryId,C.OverigCountryId,0)) AND
(C.Tel1 LIKE '%' + @strTel1 + '%' OR C.Tel2 LIKE '%' + @strTel1 + '%') AND
C.Opmerking LIKE '%' + @memOpmerking + '%' AND
C.Inactief = @bitInactief AND*/
C.CustomerId = @CustomerId |
[ Voor 12% gewijzigd door Tinuske op 03-01-2005 11:56 ]