title: Should the column used to order results be included in the index of a postgresql table?
body: <p>I am creating indexes for a PostgreSQL database. I would like to know whether the column(s) used to order results in a PostgreSQL statement should be included in the index.</p>
  <p>Assume I have created a table with label 'table1' in a PostgreSQL database with columns labelled 'col1', 'col2' and 'col3'.</p>
  <p>I would like to execute the following query:</p>
  <pre><code>SELECT * FROM table1 WHERE col1 = 'word1' AND col2 = 'word2' ORDER BY col3;
  </code></pre>
  <p>I know that an index for this search should include all columns referenced in the <code>WHERE</code> clause so, in this case, the index would include col1 and col2.</p>
  <p>Should the index also include col3?</p>