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

  1. either create index on name column (as written in comments), or
  2. use indexed column in where statement, e.g. product id if table contains that.

Comments

Popular posts from this blog

symfony - TEST environment only: The database schema is not in sync with the current mapping file -

twig - Using Twigbridge in a Laravel 5.1 Package -

jdbc - Not able to establish database connection in eclipse -