The update query is taking forever because you have introduce a cross join between the point table and a copy of it (UPDATE table1 SET ... FROM table1 AS t1). We can see that in the explain plan with the number of rows to be updated (rows=15 380 552 946 848)
When doing an update, each row is processed individually so you don'
t need the lateral join. You ...
I'm not sure this is the answer to your question, but anyhow.
I often regularly change a shapefile externally, in my case when working on a C++ program and effectively using QGIS as the visual part of the debugger :)
I removed and reloaded the layer often, now I simply start an editing session and close it.
Done, i.e. I get the refreshed shape. This is going ...
Using Emil's code I was able to make it work with some alterations. I needed to calculate the field first, then it gave the cursor something to compare it to. Here's the result
FClass = arcpy.GetParameterAsText(0)
Field = arcpy.GetParameterAsText(1)
Feature = arcpy.GetParameterAsText(2)
Feature1 = arcpy.GetParameterAsText(3)
Feature2 = arcpy....
The field name ("AccountNo") needs to be in your cursor field inputs. Something like this:
for fc in arcpy.ListFeatureClasses("Comps"):
arcpy.AddField_management(fc, "Comp_Num", "TEXT", field_length = 10)
with arcpy.da.UpdateCursor(fc, ["AccountNo", "Comp_Num"]) as cursor:
for acc, comp in cursor:
if acc == Feature1: