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

From Claudio Freire
Subject Re: A very long running query....
Date
Msg-id CAGTBQpb7XZ3Q_tkC86qB9jy0AEoy-BZZAZPQ+qRQhsgOsN3K_A@mail.gmail.com
Whole thread Raw
In response to Re: A very long running query....  (Claudio Freire <klaussfreire@gmail.com>)
Responses Re: A very long running query....
List pgsql-performance
On Sat, Jul 21, 2012 at 5:10 PM, Claudio Freire <klaussfreire@gmail.com> wrote:
> <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.

Btw... did you try the hash thing?

pgsql-performance by date:

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