I am using MySQL version 5.6.10
I have a very big table
large_table and a relatively small table
small_table has only the records of the date
There is a column where I want to update
small_table whose entry is in
large_table, I have a unique key to find the line and then get the column
large_table and update it in `small_table.
I ran the following query
update small_table, large_table set small_table.start_time = large_table.start_time where small_table.uuid = large_table.uuid ;
The above query takes a very long time. I was wondering if I could improve the query by specifying the date range in
large_table to like
update small_table, large_table set small_table.start_time = large_table.start_time where small_table.uuid = large_table.uuid and large_table.time >= '2019-11-20' and large_table.time < '2019-11-21' ;
Would the above query reduce the execution time?
Basically, I want to know what is Would it make a difference to specify area and match, or does the area matter if the match is specified,
As @danblack mentioned in the comment, I would like to add another question.
I could tell you if I have an index
large_table but I know what impact it would have in another case.
So I would like to know too How would that affect if
large_tablehad indexing, but
small_tablehad indexing, but
large_tablehad no indexing