Add index to speed up query
Fix to remove time consuming queries

will_paginate uses select count(*) to be able to count all
records or subset af all records. select count(*) is very
time consuming in postgresql.

Read more about it: http://wiki.postgresql.org/wiki/Slow_Counting