title: Update statement optimization (functions in the where clause)
body: <p>I feel dumb right now.</p>
  
  <p>I got to update 100.000 rows on a database that i don't have direct access to. The total row count of the table is roughtly 500.000 rows.
  The update just adds one caracter to a field in case it's length is &lt; 3. So Basically:</p>
  
  <p>UPDATE X SET VALUE = '0'||VALUE WHERE LENGTH(VALUE) &lt; 3</p>
  
  <p>So i send this update to the DBA's and they return it to me saying that the statement has too much performance cost (because the full access table and the 100k commit)
   and that i should write a proces instead. And then they provide me a code example, in case i don't know how to make one. </p>
  
  <p>I say WTF, how a process would ever run faster than a single update statement? Afer doing doing some tests, my update takes 30 seconds to run,
   the process, following their code example, takes 10 minutes.</p>
  
  <p>So the real question, after all this frustation, is: Is there any way to avoid the full acces table when using such a function in the where clause? (the column is indexed)</p>