From: | Claudio Freire <klaussfreire(at)gmail(dot)com> |
---|---|
To: | Ioannis Anagnostopoulos <ioannis(at)anatec(dot)com> |
Cc: | pgsql-performance(at)postgresql(dot)org |
Subject: | Re: A very long running query.... |
Date: | 2012-07-21 20:11:27 |
Message-ID: | CAGTBQpb7XZ3Q_tkC86qB9jy0AEoy-BZZAZPQ+qRQhsgOsN3K_A@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-novice pgsql-performance |
On Sat, Jul 21, 2012 at 5:10 PM, Claudio Freire <klaussfreire(at)gmail(dot)com> wrote:
> <ioannis(at)anatec(dot)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?
From | Date | Subject | |
---|---|---|---|
Next Message | Ioannis Anagnostopoulos | 2012-07-21 20:29:28 | Re: A very long running query.... |
Previous Message | Claudio Freire | 2012-07-21 20:10:51 | Re: A very long running query.... |
From | Date | Subject | |
---|---|---|---|
Next Message | Ioannis Anagnostopoulos | 2012-07-21 20:29:28 | Re: A very long running query.... |
Previous Message | Claudio Freire | 2012-07-21 20:10:51 | Re: A very long running query.... |