Re: Re: pg_dump and LOs (another proposal)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
Cc: Pavel(dot)Janik(at)linux(dot)cz, pgsql-hackers(at)postgreSQL(dot)org
Subject: Re: Re: pg_dump and LOs (another proposal)
Date: 2000-07-06 06:32:56
Message-ID: 27677.962865176@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
> At 13:06 5/07/00 -0400, Tom Lane wrote:
>> UPDATE userTable SET oidcolumn = tmptable.newLOoid WHERE
>> oidcolumn = tmptable.oldLOoid;

> It's actually nastier than this since there could be multiple oid columns,
> implying, potentially, multiple scans of the table.

So?

> I suppose

> update userTable set
> oidCol1 = Coalesce( (Select newLOoid from oidxref where oldLOoid = oidCol1
> ), oidCol1 ),
> oidCol2 = Coalesce( (Select newLOoid from oidxref where oldLOoid = oidCol2
> ), oidCol2 ),
> ...

> would work, or at least only update each row once, but it looks slow.

Almost certainly slower than processing each column in a separate
UPDATE. It does not pay to try to be smarter than the planner is ;-)

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Hannu Krosing 2000-07-06 06:36:47 Re: Proposed new libpq API
Previous Message Tom Lane 2000-07-06 06:26:11 Re: Array type confusion