I would like to know the performance difference in updating a table using the following method:
UPDATE films SET kind = 'Dramatic' WHERE CURRENT OF c_films;
or like this:
UPDATE films SET kind = 'Dramatic' WHERE unique_indexed_int_column = 3000;
Has anyone tested this or know how updates using cursors work so they can comment on this?
EDIT: I have now benchmarked this and found that it is infact around a third faster to do the latest example. I ran each of the queries 100000 times and timed the difference. I used psycopg2 using server side cursors to communicate with Postgres. I will investigate further to see whether I can find that this is not always the case.