title: PostgreSQL. Can run update query in parallel?
body: <p>I have a big table with 10M rows. And I need to get some statistic value for each row. I have function that generate this value, for example <code>GetStatistic(uuid)</code>. This functions works very slow and result value changes not often, so i've created column <code>Statistic</code> in my table, and once a day execute query like this:</p>
  <pre class="lang-sql prettyprint-override"><code>UPDATE MyTable SET Statistic = GetStatistic(ID);
  </code></pre>
  <p>And in select queries i use column <code>Statistic</code> without calling <code>GetStatistic</code> functions.</p>
  <p>Problem is, that my production server has 64 CPUs and a lot of memory, so nearly all DB can be cached to RAM, but this query use only one CPU and need 2 or 3 hours to execute.</p>
  <p>GetStatistic function use table, that are constant during all execution of <code>UPDATE</code> query. Can i modify query to get postgre to calculate <code>GetStatistic</code> in parallel for different rows simultaneously, using all avaliable CPUs?</p>