Re: COALESCE implementation question
От | Philip Warner |
---|---|
Тема | Re: COALESCE implementation question |
Дата | |
Msg-id | 3.0.5.32.20000805181711.01e4a3a0@mail.rhyme.com.au обсуждение исходный текст |
Ответ на | Re: COALESCE implementation question (Philip Warner <pjw@rhyme.com.au>) |
Список | pgsql-hackers |
At 17:22 5/08/00 +1000, Philip Warner wrote: >P.S. What's worse, I should have mentioned that the plan *with* indexes >seems flawed: > >Create Table t1(f1 int); >Create Table t1(f1 int, f2 int); >Create Unique Index t2f1 on t2(f1); >Create Unique Index t2f2 on t2(f2); > >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) > Oddly enough, I now think that the EXPLAIN output is a lie; it seems that it never does a sequential scan. So I am now even more confused... ---------------------------------------------------------------- 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 |/
В списке pgsql-hackers по дате отправления: