title: Create an index over distinct values of a column in PostgreSQL
body: <p>I have a PostgreSQL table that looks like this:</p>
  
  <pre><code>CREATE TABLE items (
      name TEXT NOT NULL,
      value TEXT NOT NULL,
      PRIMARY KEY (name, value)
  );
  </code></pre>
  
  <p>I frequently do a query to see what <code>value</code>s are available:</p>
  
  <pre><code>SELECT DISTINCT value FROM items;
  </code></pre>
  
  <p>How do I create an index in PostgreSQL that the above query to not have to iterate over all of the <code>items</code> table?</p>