postgres_adapter.rb: use subquery to reduce query number
postgres_adapter.rb: use subquery to reduce query number

mmolhoek/dm-is-reflective,godfat/dm-is-reflective,godfat/dm-is-reflective,mmolhoek/dm-is-reflective