P)LEFT OUTER JOIN ot_kat_prod AS pz ON ( p.p_id = pz.p_id ) WHERE p.a_id = a.id AND a.id = '105391105424941' AND O_kat_prod_p_id_idx on o_kat_prod is still not used:ĮXPLAIN ANALYZE SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id FROM ( ot_adresse AS a CROSS JOIN ot_produkt AS This uses the index o_produkt_a_id_idx on o_produkt, but the index Join without the explicit cross join but far away from the speed of the Thanks for the suggestion, but the result is close to the original outer > FROM (ot_adresse AS a CROSS JOIN ot_produkt AS p) > constraints don't constrain that join at all. > ot_kat_prod first, which is terribly inefficient because the WHERE > In 7.2 (and 7.3), this syntax forces the planner to join ot_produkt to > LEFT OUTER JOIN ot_kat_prod AS pz ON ( p.p_id = pz.p_id ) > SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id > i've a speed problem withe the following statement: There is no intelligent live down in Redmond. > Index Scan using o_kat_prod_p_id_idx on o_kat_prod (cost=0.00.17.42 rows=5 width=170) (actualĭo i've any chance to get the indexes used in the OUTER JOIN? > Index Scan using o_produkt_a_id_idx on o_produkt (cost=0.00.17.83 rows=1 width=68) (actual > Seq Scan on o_kat_prod (cost=.51 rows=40851 width=170) (actualĮXPLAIN ANALYZE SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id FROM ot_adresse AS a, ot_produkt AS p, > Seq Scan on o_produkt (cost=4.06 rows=6640 width=68) (actual > Index Scan using o_adresse_id_uidx on o_adresse (cost=0.00.5.96 rows=1 width=34) (actual These are the EXPLAIN ANALYZE output of both statements onĮXPLAIN ANALYZE SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id FROM ot_adresse AS a, ot_produkt AS p LEFT OUTER This is terrible slow compared to the inner join:įROM ot_adresse AS a, ot_produkt AS p, ot_kat_prod AS pz LEFT OUTER JOIN ot_kat_prod AS pz ON ( p.p_id = pz.p_id ) SELECT DISTINCT pz.l1_id, pz.l2_id, pz.l3_id, pz.l4_id I've a speed problem withe the following statement:
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |