Re: v7.2.3 versus v7.3 -> huge performance penalty for JOIN with UNION
От | ir. F.T.M. van Vugt bc. |
---|---|
Тема | Re: v7.2.3 versus v7.3 -> huge performance penalty for JOIN with UNION |
Дата | |
Msg-id | 200212030051.03635.ftm.van.vugt@foxi.nl обсуждение исходный текст |
Ответ на | v7.2.3 versus v7.3 -> huge performance penalty for JOIN with UNION ("ir. F.T.M. van Vugt bc." <ftm.van.vugt@foxi.nl>) |
Ответы |
Re: v7.2.3 versus v7.3 -> huge performance penalty for JOIN with UNION
|
Список | pgsql-performance |
(Should probably be in [SQL] by now....) I've changed my table declarations to agree on the datatypes and only one simular problem with an update-query doesn't seem to be solved. (see plan below) * the concatenation in the lbar select can't be avoided, it's just the way the data is => this does result in a resulting type 'text', AFAIK * the aux_address.old_id is also of type 'text' Still, the planner does a nested loop here against large costs... ;( Any hints on this (last) one....? TIA, Frank. trial=# explain update address set region_id = lbar.region_id from (select debtor_id || '-' || address_seqnr as id, region_id from list_base_regions) as lbar, aux_address aa where lbar.id = aa.old_id and address.id = aa.id; QUERY PLAN ---------------------------------------------------------------------------------------------------------------------- Merge Join (cost=1.07..65.50 rows=3 width=253) Merge Cond: ("outer".id = "inner".id) -> Nested Loop (cost=0.00..643707.03 rows=3980 width=28) Join Filter: (((("inner".debtor_id)::text || '-'::text) || ("inner".address_seqnr)::text) = "outer".old_id) -> Index Scan using aux_address_idx2 on aux_address aa (cost=0.00..81.88 rows=3989 width=16) -> Seq Scan on list_base_regions (cost=0.00..71.80 rows=3980 width=12) -> Sort (cost=1.07..1.08 rows=3 width=225) Sort Key: address.id -> Seq Scan on address (cost=0.00..1.05 rows=3 width=225) Filter: ((id = 1) IS NOT TRUE) (10 rows)
В списке pgsql-performance по дате отправления: