mysql - Single row UPDATE query in SQL takes more than 3 seconds -
update `productdata`.`productlist` set `datelastupdated` = curdate(), `totalreviews` = 100 `productlist`.`name` = 'firstchefproultrasharpdualjuliennepeelervegetablepeelerstainless';
this query takes 2.93 seconds , affects single row.
the table ~75k rows long. don't have experience in sql, there better way this? updating single row shouldn't take long
i'm using latest version of sql on ubuntu server
if need more information ask , i'll add post.
thanks
edit:
i didn't know sql , mysql different things.
the select statement
select * `productlist` `productlist`.`name` = 'firstchefproultrasharpdualjuliennepeelervegetablepeelerstainless';
takes 2.88 seconds, guess problem index.
edit:
thankyou help
when try create index on name says this:
error 1170 (42000): blob/text column 'name' used in key specification without key length
edit:
switched name varchar(64)
its faster now
thanks everyone
- either create index on
name
column (as written in comments), or - use indexed column in
where
statement, e.g. product id if table contains that.
Comments
Post a Comment