An index on domain cannot be used to satisfy your WHERE clause, because you
are comparing the result of a function performed on domain to a value. As
soon as you feed your column to a function, you lose the use of an index on
that column. So, each and every one of these queries performs a full
First create a table with the "fixed" domain names:
CREATE TABLE FixedDomains
SELECT DISTINCT domain, left( domain, instr( domain, '.'> ) -1 ) as
newdomain
FROM url_cat
Index your new table (for speed):
ALTER FixedDomains ADD INDEX (Domain)
*** NOTE: You really want to review (and modify, if n
Hi all
I have a problem with slow update queries like these (5 examples):
update url_cat set domain = '01net' where left( domain, instr( domain, '.' )
-1 ) = '01net';
update url_cat set domain = '1-meta' where left( domain, instr( domain, '.'
) -1 ) = '1-meta';
update url_cat set domain = '105'