Could this query be made more efficient?
It takes ages to run it. It strips of everything from an email address and keeps only the domain.
SUBSTRING(Mailaddress, CHARINDEX('@.', Mailaddress) + 1, CHARINDEX('.', SUBSTRING(Mailaddress, CHARINDEX('@.', Mailaddress) + 1, 100)) - 1) AS mail_domaingot 2005? string manipulation is faster in CLR.|||unfortunately no i don't. I may upgrade soon but for now it is 2000 im using.|||I assume that if you take this column out of the select list, the plan remains the same, but the query time goes up? Does the query time remain the same when you add the raw email address to the select list (and comment out all the substringing)? I am wondering, if you accidentally got a covering index on all of the fields not associated with the email addresses, or maybe the query is using different indexes for the query with all the substrings.
Also, not to be a nit picker, but which part of the domain are you after? An email address can be very complex. My brother has an email address that ends in @.haystack.mit.edu. Some of our British posters would have addresses like @.company.co.uk. I am guessing you would be interested in the "mit" or the "company", but not in "co' or "haystack".|||yes its from select list and no joins so it should be very fast. I se now that i have to make this to work with thoose split domain names aswell... damn :)
My question about the query was more kinda of " is this a stupid way to do this"?
i can live with the time it takes to run this query it is after al quite a large table.
thx for your help
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment