Re: Improve query speed?

From: Luca Ferrari <fluca1978(at)infinito(dot)it>
To: James David Smith <james(dot)david(dot)smith(at)gmail(dot)com>
Cc: "pgsql-novice(at)postgresql(dot)org" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Improve query speed?
Date: 2013-08-27 13:25:11
Message-ID: CAKoxK+7wYv++SpTNf9Nr=G8A_mHaRNX+B=rButwikaVUyQbQzQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Tue, Aug 27, 2013 at 12:26 PM, James David Smith
<james(dot)david(dot)smith(at)gmail(dot)com> wrote:
> Hi there,
>
> I was wondering if anyone had any ideas on how to make this UPDATE
> query any quicker please?
>
> UPDATE stage_cleaned
> SET route_geom =
> (SELECT route_geom.wkb_geometry FROM route_geom WHERE
> route_geom.stage_cleaned_id::text = stage_cleaned.id::text GROUP BY
> stage_cleaned_id, wkb_geometry)
> WHERE route_geom IS NULL;

Well, hard to say if you do not provide information about what you
mean with "quicker" and about how the inner select is executed. I
would recommend running the inner join query alone and see how the
planner is going to extract the data from it.

Luca

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Charles Sheridan 2013-08-27 14:08:00 CTAGS for PG/sql ?
Previous Message James David Smith 2013-08-27 10:26:22 Improve query speed?