Re: COALESCE implementation question

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)hub(dot)org
Subject: Re: COALESCE implementation question
Date: 2000-08-06 03:23:29
Message-ID: 3.0.5.32.20000806132329.024014c0@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 22:27 5/08/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> explain update t1 set f1 = Coalesce( (select f2 from t2 x where x.f1 =
>> t1.f1), t1.f1);
>> NOTICE: QUERY PLAN:
>
>> Seq Scan on t1 (cost=0.00..20.00 rows=1000 width=10)
>> SubPlan
>> -> Index Scan using t2f1 on t2 x (cost=0.00..8.14 rows=10 width=4)
>> -> Seq Scan on t2 x (cost=0.00..22.50 rows=1000 width=4)
>
>This is a bug caused by interaction between two planning passes run
>on the same Query node. The parser thinks it's cool to generate a
>CASE parsetree with multiple paths to the same sub-select Query node,
>but in fact it is not cool because planning destructively alters the
>Query node contents. I'm amazed it didn't crash, to tell the truth.
>
>I have a patch but haven't applied it yet (been offline for most of
>two days due to telco idiocy :-().

Thanks for this; I must admit I was very surprised not to get a response
withing 24 hours! Is there any chance of sending me the patch - I have been
looking at the sources for a while now, and it would be nice to see the
answer...

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.C.N. 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-08-06 03:28:08 Re: COALESCE implementation question
Previous Message Philip Warner 2000-08-06 03:22:03 Re: COALESCE implementation question