Now I feel dumb.
I need to update 100,000 rows in a database that I do not have direct access to. The total number of rows in the table is about 500,000 rows. The update simply adds one character to the field if the length is <3. Basically:
UPDATE X SET VALUE = '0' || VALUE WHERE LENGTH (VALUE) <3
So, I send this update to the database administrator and they return it to me, saying that the statement is too expensive (because the table is full access and the commit is 100k) and that I should write proces instead. And then they provide me with sample code if I don't know how to create it.
I tell WTF, how will a process run faster than a single update statement? Afer does some tests, my update takes 30 seconds, the process, following the code example, takes 10 minutes.
So, the real question, after all this decomposition, is this: is there a way to avoid the full acces table when using such a function in the where clause? (index is indexed)
source
share