EXPLAIN ANALYZE
cia/ = 29 Juin, 2006 - 17:48
Bonjour,
Comme convenu, voici le EXPLAIN ANALYZE de la requête qui se traîne sous PG 8 + FC4
SELECT DISTINCT m.id_produitgen, m.etat, m.foyer, m.matieredeverre, m.code, m.nom, m.codediametre, m.indicerefraction, m.prixvente, f.raisonsociale FROM ( SELECT m.*, c.catalogue FROM ( SELECT m.id, m.nom, m.foyer, m.indicerefraction, m.code, m.matieredeverre, p.etat, g.codediametre, g.prixvente, g.id_produitgen FROM modeledeverre m, promotions p, ( SELECT c.*, p.prixvente FROM ( SELECT c.modeledeverre, d.codediametre, c.id_produitgen FROM ( SELECT gr.modeledeverre, gr.diametreverre, gr.id_produitgen FROM grillefabricationverre gr INNER JOIN zonefabrication z ON z.id = gr.zonefabrication WHERE z.cylindremin<=0 AND z.cylindremax>=0 AND z.spherebasgauche<=0.0 AND z.spherehautgauche>=0.0 ) c INNER JOIN diametreverre d ON c.diametreverre=d.id ) c , plagetarif p, grillefabricationverre g, diametreverre d WHERE p.id_grille = g.id_produitgen AND g.diametreverre = d.id AND d.codediametre = c.codediametre AND c.modeledeverre = g.modeledeverre AND p.cylindredebut<=0.0 AND p.cylindrefin>=0.0 AND p.spheredebut<=0.0 AND p.spherefin>=0.0 ) g WHERE m.id=g.modeledeverre AND m.actif = true AND m.promotion=p.id AND m.foyer = 1000 AND m.matieredeverre=1000 ) m INNER JOIN modele_catalogue c ON m.id=c.id ) m INNER JOIN ( SELECT catalogue.id, ent.raisonsociale FROM catalogue INNER JOIN (SELECT e.id, e.raisonsociale FROM entreprises e WHERE e.raisonsociale = 'ESSILOR') ent ON ent.id = catalogue.fournisseur ) f ON m.catalogue=f.id
Unique (cost=3029.87..3029.90 rows=1 width=1629) (actual time=57598.519..57600.986 rows=192 loops=1)
-> Sort (cost=3029.87..3029.87 rows=1 width=1629) (actual time=57598.508..57599.177 rows=192 loops=1)
Sort Key: gr.id_produitgen, p.etat, m.foyer, m.matieredeverre, m.code, m.nom, d.codediametre, m.indicerefraction, p.prixvente, e.raisonsociale
-> Nested Loop (cost=190.90..3029.86 rows=1 width=1629) (actual time=39739.474..57593.245 rows=192 loops=1)
Join Filter: ("inner".id = "outer".fournisseur)
-> Hash Join (cost=190.90..3026.18 rows=1 width=1237) (actual time=289.064..57455.036 rows=1029 loops=1)
Hash Cond: ("outer".catalogue = "inner".id)
-> Nested Loop (cost=189.73..3024.93 rows=15 width=1237) (actual time=278.951..57430.417 rows=1029 loops=1)
-> Nested Loop (cost=189.73..2978.34 rows=1 width=1253) (actual time=267.808..57341.548 rows=469 loops=1)
-> Nested Loop (cost=189.73..2972.46 rows=1 width=1260) (actual time=257.125..57282.424 rows=469 loops=1)
Join Filter: ("inner".id_grille = "outer".id_produitgen)
-> Nested Loop (cost=189.73..308.27 rows=1 width=1260) (actual time=215.740..377.389 rows=636 loops=1)
Join Filter: (("inner".codediametre)::text = ("outer".codediametre)::text)
-> Hash Join (cost=189.73..296.31 rows=2 width=1268) (actual time=215.577..292.916 rows=1896 loops=1)
Hash Cond: ("outer".modeledeverre = "inner".modeledeverre)
-> Seq Scan on grillefabricationverre g (cost=0.00..84.57 rows=4357 width=24) (actual time=0.010..23.191 rows=4357 loops=1)
-> Hash (cost=189.73..189.73 rows=1 width=1244) (actual time=212.886..212.886 rows=0 loops=1)
-> Nested Loop (cost=53.40..189.73 rows=1 width=1244) (actual time=55.594..210.516 rows=469 loops=1)
-> Nested Loop (cost=53.40..183.76 rows=1 width=852) (actual time=39.392..133.257 rows=469 loops=1)
-> Hash Join (cost=53.40..159.80 rows=4 width=860) (actual time=25.013..73.515 rows=1060 loops=1)
Hash Cond: ("outer".modeledeverre = "inner".id)
-> Seq Scan on grillefabricationverre gr (cost=0.00..84.57 rows=4357 width=32) (actual time=9.862..30.558 rows=4357 loops=1)
-> Hash (cost=53.40..53.40 rows=1 width=828) (actual time=12.487..12.487 rows=0 loops=1)
-> Seq Scan on modeledeverre m (cost=0.00..53.40 rows=1 width=828) (actual time=5.041..11.130 rows=299 loops=1)
Filter: ((actif = true) AND (foyer = 1000) AND (matieredeverre = 1000))
-> Index Scan using zonefabrication_pkey on zonefabrication z (cost=0.00..5.98 rows=1 width=8) (actual time=0.042..0.044 rows=0 loops=1060)
Index Cond: (z.id = "outer".zonefabrication)
Filter: ((cylindremin <= 0::double precision) AND (cylindremax >= 0::double precision) AND (spherebasgauche <= 0::double precision) AND (spherehautgauche >= 0::double precision))
-> Index Scan using diametreverre_pkey on diametreverre d (cost=0.00..5.96 rows=1 width=408) (actual time=0.141..0.146 rows=1 loops=469)
Index Cond: ("outer".diametreverre = d.id)
-> Index Scan using diametreverre_pkey on diametreverre d (cost=0.00..5.96 rows=1 width=408) (actual time=0.016..0.023 rows=1 loops=1896)
Index Cond: ("outer".diametreverre = d.id)
-> Seq Scan on plagetarif p (cost=0.00..2650.94 rows=1060 width=16) (actual time=0.041..76.048 rows=3644 loops=636)
Filter: ((cylindredebut <= 0::double precision) AND (cylindrefin >= 0::double precision) AND (spheredebut <= 0::double precision) AND (spherefin >= 0::double precision))
-> Index Scan using promotions_pkey on promotions p (cost=0.00..5.87 rows=1 width=9) (actual time=0.090..0.095 rows=1 loops=469)
Index Cond: ("outer".promotion = p.id)
-> Index Scan using modele_catalogue_pkey on modele_catalogue c (cost=0.00..46.41 rows=15 width=16) (actual time=0.111..0.151 rows=2 loops=469)
Index Cond: (c.id = "outer".modeledeverre)
-> Hash (cost=1.13..1.13 rows=13 width=16) (actual time=9.990..9.990 rows=0 loops=1)
-> Seq Scan on catalogue (cost=0.00..1.13 rows=13 width=16) (actual time=9.864..9.922 rows=13 loops=1)
-> Seq Scan on entreprises e (cost=0.00..3.66 rows=1 width=408) (actual time=0.095..0.116 rows=1 loops=1029)
Filter: ((raisonsociale)::text = 'ESSILOR'::text)
Total runtime: 57602.485 ms
43 row(s)
Total runtime: 58,201.784 ms
SQL executed.
Désolé pour la lourdeur du message mais je n'ai pas trouvé comment joindre un fichier et/ou une image. A votre disposition pour des informations complémentaires.
Cordialement
[ Vous devez
vous connecter pour poster des commentaires ]