Also ich bekomm als Ergebnis bei meiner ProblemAnfrage : SQL-Befehl: EXPLAIN SELECT `terms`. * FROM `terms` INNER JOIN sims ON sims.term2_id = terms.id INNER JOIN terms terms2 ON sims.term1_id = terms2.id WHERE ( terms2.bezeichnung IN ( 'deutschland' ) ) ORDER BY sims.similarity DESC LIMIT 15 ;
folgendes (3 Zeilen) : id :1 select_type :SIMPLE table :terms type :ALL possible_keys :PRIMARY key :NULL key_len :NULL ref :NULL rows :92790 Extra: Using temporary; Using filesort id :1 select_type :SIMPLE table :sims type :ref possible_keys :term1_id,term2_id key :term2_id key_len :5 ref :mytag_development.terms.id rows :3 Extra: Using where id :1 select_type :SIMPLE table :terms2 type : eq_ref possible_keys :PRIMARY key :PRIMARY key_len :4 ref :mytag_development.sims.term1_id rows :1 Extra :Using where Die andere Anfrage liefert mir hingegen (3 Zeilen) : SQL-Befehl: EXPLAIN SELECT `terms`. * FROM `terms` INNER JOIN sims ON sims.term1_id = terms.id INNER JOIN terms terms2 ON sims.term2_id = terms2.id WHERE ( terms2.bezeichnung IN ( 'deutschland' ) ) ORDER BY sims.similarity DESC LIMIT 5 ; id :1 select_type :SIMPLE table :terms2 type :ALL possible_keys :PRIMARY key :NULL key_len :NULL ref :NULL rows :92790 Extra:Using where; Using temporary; Using filesort id :1 select_type :SIMPLE table :sims type :ref possible_keys :term1_id,term2_id key :term2_id key_len :5 ref :mytag_development.terms2.id rows :3 Extra:Using where id :1 select_type :SIMPLE table :terms type :eq_ref possible_keys :PRIMARY key :PRIMARY key_len :4 ref :mytag_development.sims.term1_id rows :1 Extra:Using where Ob das gut oder schlecht ist, kann ich leider nicht sagen, da ich zuwenig Ahnung habe, aber vielleicht kannst du mir ein wenig was erklären Michael. Danke nochmal für deine Zeit Grüße M.Sch -- Posted via http://www.ruby-forum.com/.
_______________________________________________ rubyonrails-ug mailing list [email protected] http://mailman.headflash.com/mailman/listinfo/rubyonrails-ug
