Re: getting the ranks out of items with SHARED

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Janning Vygen <vygen(at)gmx(dot)de>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: getting the ranks out of items with SHARED
Date: 2005-07-13 13:35:55
Message-ID: 27411.1121261755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Janning Vygen <vygen(at)gmx(dot)de> writes:
> this way it works:

> CREATE TEMP TABLE ranking AS *Q*;
> EXECUTE 'UPDATE temp_gc SET gc_rank = ranking.rank
> FROM ranking WHERE temp_gc.mg_name = ranking.mg_name;';

> and this way it doesn't:

> UPDATE temp_gc
> SET gc_rank = ranking.rank
> FROM (*Q*)
> ranking
> WHERE temp_gc.mg_name = ranking.mg_name;

It's difficult to be sure without looking at EXPLAIN output, but I would
guess that the second query is being done with a plan that involves
multiple scans of "*Q*", and that's confusing your function.

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gnanavel S 2005-07-13 13:42:54 Re: INSERT INTO from a SELECT query
Previous Message Michael Fuhr 2005-07-13 13:23:29 Re: Strange memory behaviour with PGreset() ...