I am using MySQL version 5.6.10
I have a very very large table
large_table and a relatively small table
small_table has only the records of the date
There is a column I want to update in
small_table whose entry is in
large_table. I have a unique key using which I would find the row and then get the column from
large_table and update it in `small_table.
I have run 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 is taking very very long. I was wondering if I can improve the query by specifying the range of date in
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 improve time of execution ?
Basically what I want to know is would it make a difference to specify range and match both or the range does not matter when the match is specified.
Also, as @danblack mentioned in the comment, I would like to add one more question.
I could tell you if I have indexing on
large_table but I do know what impact it would have in a different case.
So, I would also like to know how would result be affected if
large_tablehad indexing, but
small_tablehad indexing, but
large_tabledidn't have indexing