I adapted your code to work with a string unique key and a set of file geodatabase tables with 3124 US counties, copying the contents of randomly generated rnd_val from one table to another, using various improvements...
First, I modularized your code, using variables for field names and str.format instead of string math:
import os
import datetime
print('Importing arcpy....')
import arcpy
fc1 = r'D:\GIS_SE\gisse.gdb\counties1'
fc2 = r'D:\GIS_SE\gisse.gdb\counties3'
fldUnique = 'fips'
fldSource = 'rnd_val'
fldDest = 'rnd_val'
start = datetime.datetime.utcnow()
with arcpy.da.SearchCursor(fc1, [fldUnique]) as cursor:
for row in cursor:
where_string = "{:s} = '{:s}'".format(fldUnique,row[0])
with arcpy.da.SearchCursor(fc1, [fldSource], where_string) as cursor2:
for row2 in cursor2:
updatedValue = row2[0]
with arcpy.da.UpdateCursor(fc2, [fldDest], where_string) as cursor3:
for row3 in cursor3:
row3[0] = updatedValue
cursor3.updateRow(row3)
elapsed = (datetime.datetime.utcnow() - start).total_seconds()
print("{:>16s} : {:.3f}".format('Pass1',elapsed))
This executed in 201.639 seconds.
Then I eliminated the redundant second cursor:
start = datetime.datetime.utcnow()
with arcpy.da.SearchCursor(fc1, [fldUnique,fldSource]) as cursor:
for row in cursor:
where_string = "{:s} = '{:s}'".format(fldUnique,row[0])
UpdatedValue = row[1]
with arcpy.da.UpdateCursor(fc2, [fldDest], where_string) as cursor3:
for row3 in cursor3:
row3[0] = UpdatedValue
cursor3.updateRow(row3)
elapsed = (datetime.datetime.utcnow() - start).total_seconds()
print("{:>16s} : {:.3f}".format('Pass2',elapsed))
This executed in 99.306 seconds.
Then I used a FGDB table with an index on the unique field:
start = datetime.datetime.utcnow()
fc2 = r'D:\GIS_SE\gisse.gdb\counties2'
with arcpy.da.SearchCursor(fc1, [fldUnique,fldSource]) as cursor:
for row in cursor:
where_string = "{:s} = '{:s}'".format(fldUnique,row[0])
updatedValue = row[1]
with arcpy.da.UpdateCursor(fc2, [fldDest], where_string) as cursor3:
for row3 in cursor3:
row3[0] = updatedValue
cursor3.updateRow(row3)
elapsed = (datetime.datetime.utcnow() - start).total_seconds()
print("{:>16s} : {:.3f}".format('Pass3',elapsed))
This ran in 23.358 seconds.
Just for grins, I ran the triple-nested query on the indexed table:
start = datetime.datetime.utcnow()
fc1 = r'D:\GIS_SE\gisse.gdb\counties2'
fc2 = r'D:\GIS_SE\gisse.gdb\counties2'
with arcpy.da.SearchCursor(fc1, [fldUnique]) as cursor:
for row in cursor:
where_string = "{:s} = '{:s}'".format(fldUnique,row[0])
with arcpy.da.SearchCursor(fc1, [fldSource], where_string) as cursor2:
for row2 in cursor2:
updatedValue = row2[0]
with arcpy.da.UpdateCursor(fc2, [fldDest], where_string) as cursor3:
for row3 in cursor3:
row3[0] = updatedValue
cursor3.updateRow(row3)
elapsed = (datetime.datetime.utcnow() - start).total_seconds()
print("{:>16s} : {:.3f}".format('Pass4',elapsed))
This ran in 44.215 seconds (nearly twice as long as the two-cursor solution)
Finally, I used two discrete passes, caching the source values by unique key, then updating the unindexed target with a lookup:
start = datetime.datetime.utcnow()
fc1 = r'D:\GIS_SE\gisse.gdb\counties1'
fc2 = r'D:\GIS_SE\gisse.gdb\counties3'
lookup = {}
with arcpy.da.SearchCursor(fc1, [fldUnique,fldSource]) as cursor:
for row in cursor:
lookup[row[0]] = row[1]
with arcpy.da.UpdateCursor(fc2, [fldUnique,fldDest]) as cursor3:
for row3 in cursor3:
row3[1] = lookup[row3[0]]
cursor3.updateRow(row3)
elapsed = (datetime.datetime.utcnow() - start).total_seconds()
print("{:>16s} : {:.3f}".format('Pass5',elapsed))
And this ran in 0.314 seconds.
Thus, I repeat my comment: Best practice would be to build a dictionary of { unique_id : col1 } pairs in one pass of the SearchCursor, then updateRow using a lookup from unique_id in an UpdateCursor pass.
Note that this code assumes 1:1 correspondence on the keys in both tables. If the target table has keys not present in the source, then you'd need to test for row3[0] in lookup and decide whether a value should be assigned, and what that value should be:
for row3 in cursor3:
row3[1] = lookup[row3[0]] if row3[0] in lookup else None
cursor3.updateRow(row3)
or
for row3 in cursor3:
if (row3[0] in lookup):
row3[1] = lookup[row3[0]]
cursor3.updateRow(row3)
If there are keys in fc1 not present in fc2, then you can detect this with a destructive read then processing the resultant dictionary pairs:
for row3 in cursor3:
if (row3[0] in lookup):
row3[1] = lookup[row3[0]]
cursor3.updateRow(row3)
del lookup[row3[0]]
for k in lookup:
print("Key '{:s}' with value '{:d}' not present in fc2!".format(
k,lookup[k]))
unique_idis varchar, a numeric comparison will fail in Python just like SQL (though casting is available in both). To complete this question, edit it to include the table definition (column names and types) for both fc1 and fc2.