Optimize inbox SQL queries

*conversation_spec given twice here