Postgresql query analysis

shape