Does range improve match operation and which runs first, range or match I am using MySQL version 5.6.10

I have a very very large table large_table and a relatively small table small_table

The small_table has only the records of the date 2019-11-20

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 large_table 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 &gt;= '2019-11-20' and large_table.time &lt; '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 small_table or 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_table had indexing, but small_table didn't
small_table had indexing, but large_table didn't
Both small_table and large_table had indexing
Both small_table and large_table didn't have indexing
As you indicated by the small_table only containing one range, adding the date adds a hint that could be used in some cases. As worst it will just add a quick condition to an already retrieved row.

'had indexing' really doesn't help, it matters what the index begins with. Indexes can have multiple parts and the order matters significantly. An index with a 'prefix of A' could include A as the entire index.

The indexing on the small_table is largely a second consideration as the entire table needs to be scanned.

A uuid as a prefix on an index (or primary) key should be considered the minimium on the large_table. In this case the small table will be scanned and each uuid will be looked up in big table.

If a time is a prefix of a index (or primary key) of the large_table, date criteria in the index be searched and matched against the small_table. It depends here if the optimizer thinks the date range in the table is bigger or small than the small_table. If there is no uuid indexes this is the only optimal solution.

If there are no indexes, much slowness will happen, i.e. the large_table will be entirely scanned for each element in small_table

To check what will be used check:

EXPLAIN
SELECT small_table.uuid, small_table.time, large_table.uuid, large_table.time
FROM small_table, large_table
WHERE 
    small_table.uuid = large_table.uuid 
    AND large_table.time &gt;= '2019-11-20' and large_table.time &lt; '2019-11-21'