Since this is postgres, can you do an EXPLAIN on that query, or preferably any similarly slow but not-so-hairy query?