SQL explaination for a few costly PostgreSLQ queries