Use derived tables with indexes for all queries: much faster in real-world use
Merge branch 'master' into dev