Re: A very long running query.... - Mailing list pgsql-performance

From Claudio Freire
Subject Re: A very long running query....
Date
Msg-id CAGTBQpY6Ma44cvGmbcsjc_BBcScec1KOv7kd2_VRU1Ss9OM3RQ@mail.gmail.com
Whole thread Raw
In response to A very long running query....  (Ioannis Anagnostopoulos <ioannis@anatec.com>)
Responses Re: A very long running query....
List pgsql-performance
On Fri, Jul 20, 2012 at 6:19 PM, Ioannis Anagnostopoulos
<ioannis@anatec.com> wrote:
>             (feed_all_y2012m07.ship_pos_messages join
> ais_server.ship_objects on (ship_pos_messages.obj_id = ship_objects.obj_id))
>             on (message_copies.msg_id = ship_pos_messages.msg_id)

It's this part of the query that's taking 3.2 hours.

Move the filtered message_copies to a CTE, and the filtered
ship_pos_messages join to another CTE. That should (in my experience)
get you better performance.

pgsql-performance by date:

Previous
From: Ioannis Anagnostopoulos
Date:
Subject: Re: A very long running query....
Next
From: Claudio Freire
Date:
Subject: Re: A very long running query....