title: Group by day of week
body: <p>I have a table <code>conversations</code> with an <code>inserted_at</code> column</p>
  
  <p>I want to draw a chart showing the amount of <code>conversations</code> created over time.</p>
  
  <p>I'd like to be able to group the data by either the date, the day of week, and the time of date, to show possible trends.</p>
  
  <p>I'll be using intervals of 7 days, 1 month and 6 months.</p>
  
  <p>Example:</p>
  
  <p>Interval: <code>1 month</code> group by <code>day of week</code></p>
  
  <p>I'd like something like</p>
  
  <pre><code>| Monday | Tuesday | Wednesday | Thursday | Friday |
  |--------|---------|-----------|----------|--------|
  | 11     | 22      | 19        | 17       | 10     |
  </code></pre>
  
  <p>or interval: <code>7 days</code> group by <code>date</code></p>
  
  <pre><code>| 1/1 | 2/1 | 3/1 | 4/1 | 5/1 | 6/1 | 7/1 |
  |-----|-----|-----|-----|-----|-----|-----|
  | 11  | 22  | 19  | 17  | 10  | 10  | 7   |
  </code></pre>
  
  <p>What is the best way to accomplish this (examples would be greatly appreciated), and is PostgreSQL fit for these kind of queries?</p>
  
  <p>Lastly, are there any special sort of indexes that will improve such queries?</p>