title: Select for Update using limit in Postgres
body: <p>I need to distribute the processing on records to different machines.</p>
  
  <p>On each of these machines(nodes), I run the following query every minutes:</p>
  
  <pre><code>select * 
  from RECORDS_TO_PROCESS
  limit MAX_PER_MACHINE_RUN
  for update
  </code></pre>
  
  <p>Hypothetically, assume that I have 1000 records to process, 10 machines(nodes) and each machine wants to process 100 records(max) in a minute. </p>
  
  <pre><code>R1
  R2
  R3
  ...
  R101
  R102
  R103
  ...
  R201
  R202
  R203
  ...
  </code></pre>
  
  <p>All I want is for Records (R1-100) to get to query made from Node1, Records (R101-R200) to be returned from query made from Node2 etc.</p>
  
  <p>Will this work? Do we think that this would be able to spread load?</p>
  
  <p>Assume that the transaction isolation level is the default one (Read Committed)</p>