title: Most performant way to update millions of records
body: <p>Any performant way to do this: <code>UPDATE entries SET tags = array_append(tags, 2) WHERE id IN [millions_of_ids_here]</code>.</p>
  <p>My table structure:</p>
  <pre><code>CREATE TABLE entries(
    id BIGINT PRIMARY,
    label VARCHAR(64) NOT NULL,
    tags INT[]
  );
  </code></pre>
  <p>There are 250 millions rows in table <code>entries</code>. I have a CSV file containing a list of id's, so I need to add a tag only to thoose ids. Example:</p>
  <p>File <code>2.csv</code>:</p>
  <pre><code>2356489520,
  0899436814,
  6471055422,
  ...
  </code></pre>
  <p>A single csv file can contain some millions of id's. In above example, I need to add <code>2</code> to <code>tags</code> of all entries of that file.</p>
  <p>Most answers I saw assume that the id's are sequentially, which is not my case.</p>