SUB-optimal postgres query plans