Why is Schatten so slow?

Sql code posted by murphy
created at 22 Jan 16:15

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
  Character.find {
  Character Load (0.4ms)  SELECT `characters`.* FROM `characters` WHERE (`characters`.`type` = 'Character') AND (`characters`.`id` = 1543492239) LIMIT 1
  } took 0.9ms
  ProtoCharacter.find {
  ProtoCharacter Load (0.2ms)  SELECT `characters`.* FROM `characters` WHERE (`characters`.`type` = 'ProtoCharacter') AND (`characters`.`id` = 867793573) LIMIT 1
  } took 0.6ms
metatype (1.1ms)
  SkillRating.find {
  SkillRating Load (0.4ms)  SELECT `skill_ratings`.* FROM `skill_ratings` WHERE (`skill_ratings`.character_id = 1543492239)
      Skill.find {
  Skill Load (0.3ms)  SELECT `skills`.* FROM `skills` WHERE (`skills`.`id` IN (812900136,815579572,2136441891,582623274,1579043411,1304735833,1553670882,1964468893,1702209636,1758919211,1309469453,397604935,1947516370,1957165604,947548493,272385008,1906015284))
      } took 1.0ms
      SkillGroup.find {
  SkillGroup Load (0.2ms)  SELECT `skill_groups`.* FROM `skill_groups` WHERE (`skill_groups`.`id` IN (1493507545,478059744,211747680,1143694726,1425142375,841949100))
      } took 0.6ms
      Skill.find {
  Skill Load (0.3ms)  SELECT `skills`.* FROM `skills` WHERE (`skills`.skill_group_id IN (1493507545,1143694726,211747680,841949100,478059744,1425142375))
      } took 1.1ms
  } took 12.9ms
  Skill.find {
  Skill Load (0.4ms)  SELECT `skills`.* FROM `skills` INNER JOIN `skill_ratings` ON `skills`.id = `skill_ratings`.skill_id WHERE ((`skill_ratings`.character_id = 1543492239))
  } took 1.4ms
skill_groups (17.6ms)
  AttributeRating.find {
  AttributeRating Load (0.3ms)  SELECT `attribute_ratings`.* FROM `attribute_ratings` WHERE (`attribute_ratings`.character_id = 1543492239)
      Attribute.find {
  Attribute Load (0.3ms)  SELECT `attributes`.* FROM `attributes` WHERE (`attributes`.`id` IN (1992544360,298781580,126377424,102535399,710763947,718401190,115212539,1109804540,98772188,1053566938))
      } took 0.7ms
  } took 2.8ms
  AttributeRating.find {
  AttributeRating Load (0.3ms)  SELECT `attribute_ratings`.* FROM `attribute_ratings` WHERE (`attribute_ratings`.character_id = 867793573)
      Attribute.find {
  Attribute Load (0.2ms)  SELECT `attributes`.* FROM `attributes` WHERE (`attributes`.`id` IN (98772188,1053566938))
      } took 0.5ms
      UberCharacter.find {
  UberCharacter Load (0.2ms)  SELECT `characters`.* FROM `characters` WHERE (`characters`.`id` = 867793573)
      } took 0.6ms
  } took 3.0ms
attribute_ratings (10.3ms)
  SkillRating.find {
      SkillRating.find {
  SkillRating Load (2.8ms)  SELECT `skill_ratings`.`id` AS t0_r0, `skill_ratings`.`character_id` AS t0_r1, `skill_ratings`.`skill_id` AS t0_r2, `skill_ratings`.`rating` AS t0_r3, `skill_ratings`.`specialization` AS t0_r4, `skill_ratings`.`build_points` AS t0_r5, `skills`.`id` AS t1_r0, `skills`.`type` AS t1_r1, `skills`.`name` AS t1_r2, `skills`.`category` AS t1_r3, `skills`.`attribute_id` AS t1_r4, `skills`.`can_default` AS t1_r5, `skills`.`skill_group_id` AS t1_r6, `attributes`.`id` AS t2_r0, `attributes`.`category` AS t2_r1, `attributes`.`name` AS t2_r2, `attributes`.`default_rating` AS t2_r3, `attributes`.`description` AS t2_r4, `skill_groups`.`id` AS t3_r0, `skill_groups`.`name` AS t3_r1, `characters`.`id` AS t4_r0, `characters`.`street_name` AS t4_r1, `characters`.`real_name` AS t4_r2, `characters`.`type` AS t4_r3, `characters`.`born_on` AS t4_r4, `characters`.`alive` AS t4_r5, `characters`.`sex` AS t4_r6, `characters`.`description` AS t4_r7, `characters`.`nuyen` AS t4_r8, `characters`.`lifestyle` AS t4_r9, `characters`.`build_points` AS t4_r10, `characters`.`karma` AS t4_r11, `characters`.`current_karma` AS t4_r12, `characters`.`street_cred` AS t4_r13, `characters`.`notoriety` AS t4_r14, `characters`.`public_awareness` AS t4_r15, `characters`.`user_id` AS t4_r16, `characters`.`created_at` AS t4_r17, `characters`.`updated_at` AS t4_r18, `characters`.`metatype_id` AS t4_r19, `characters`.`physical_damage` AS t4_r20, `characters`.`mental_damage` AS t4_r21, `characters`.`essence` AS t4_r22, `attribute_ratings`.`id` AS t5_r0, `attribute_ratings`.`character_id` AS t5_r1, `attribute_ratings`.`attribute_id` AS t5_r2, `attribute_ratings`.`rating` AS t5_r3, `attribute_ratings`.`build_points` AS t5_r4 FROM `skill_ratings` LEFT OUTER JOIN `skills` ON `skills`.`id` = `skill_ratings`.`skill_id` LEFT OUTER JOIN `attributes` ON `attributes`.`id` = `skills`.`attribute_id` LEFT OUTER JOIN `skill_groups` ON `skill_groups`.`id` = `skills`.`skill_group_id` LEFT OUTER JOIN `characters` ON `characters`.`id` = `skill_ratings`.`character_id` AND `characters`.`type` = 'Character' LEFT OUTER JOIN `attribute_ratings` ON `attribute_ratings`.`character_id` = `characters`.`id` WHERE (`skill_ratings`.character_id = 1543492239 AND (`skills`.`type` = 'ActiveSkill'))
      } took 89.1ms
  } took 129.9ms
active_skill_ratings (132.5ms)
  SkillRating.find {
      SkillRating.find {
  SkillRating Load (0.9ms)  SELECT `skill_ratings`.`id` AS t0_r0, `skill_ratings`.`character_id` AS t0_r1, `skill_ratings`.`skill_id` AS t0_r2, `skill_ratings`.`rating` AS t0_r3, `skill_ratings`.`specialization` AS t0_r4, `skill_ratings`.`build_points` AS t0_r5, `skills`.`id` AS t1_r0, `skills`.`type` AS t1_r1, `skills`.`name` AS t1_r2, `skills`.`category` AS t1_r3, `skills`.`attribute_id` AS t1_r4, `skills`.`can_default` AS t1_r5, `skills`.`skill_group_id` AS t1_r6, `attributes`.`id` AS t2_r0, `attributes`.`category` AS t2_r1, `attributes`.`name` AS t2_r2, `attributes`.`default_rating` AS t2_r3, `attributes`.`description` AS t2_r4, `characters`.`id` AS t3_r0, `characters`.`street_name` AS t3_r1, `characters`.`real_name` AS t3_r2, `characters`.`type` AS t3_r3, `characters`.`born_on` AS t3_r4, `characters`.`alive` AS t3_r5, `characters`.`sex` AS t3_r6, `characters`.`description` AS t3_r7, `characters`.`nuyen` AS t3_r8, `characters`.`lifestyle` AS t3_r9, `characters`.`build_points` AS t3_r10, `characters`.`karma` AS t3_r11, `characters`.`current_karma` AS t3_r12, `characters`.`street_cred` AS t3_r13, `characters`.`notoriety` AS t3_r14, `characters`.`public_awareness` AS t3_r15, `characters`.`user_id` AS t3_r16, `characters`.`created_at` AS t3_r17, `characters`.`updated_at` AS t3_r18, `characters`.`metatype_id` AS t3_r19, `characters`.`physical_damage` AS t3_r20, `characters`.`mental_damage` AS t3_r21, `characters`.`essence` AS t3_r22, `attribute_ratings`.`id` AS t4_r0, `attribute_ratings`.`character_id` AS t4_r1, `attribute_ratings`.`attribute_id` AS t4_r2, `attribute_ratings`.`rating` AS t4_r3, `attribute_ratings`.`build_points` AS t4_r4 FROM `skill_ratings` LEFT OUTER JOIN `skills` ON `skills`.`id` = `skill_ratings`.`skill_id` LEFT OUTER JOIN `attributes` ON `attributes`.`id` = `skills`.`attribute_id` LEFT OUTER JOIN `characters` ON `characters`.`id` = `skill_ratings`.`character_id` AND `characters`.`type` = 'Character' LEFT OUTER JOIN `attribute_ratings` ON `attribute_ratings`.`character_id` = `characters`.`id` WHERE (`skill_ratings`.character_id = 1543492239 AND (`skills`.`type` = 'KnowledgeSkill'))
      } took 4.1ms
  } took 13.6ms
knowledge_skill_ratings (14.8ms)
  SkillRating.find {
      SkillRating.find {
  SkillRating Load (1.0ms)  SELECT `skill_ratings`.`id` AS t0_r0, `skill_ratings`.`character_id` AS t0_r1, `skill_ratings`.`skill_id` AS t0_r2, `skill_ratings`.`rating` AS t0_r3, `skill_ratings`.`specialization` AS t0_r4, `skill_ratings`.`build_points` AS t0_r5, `skills`.`id` AS t1_r0, `skills`.`type` AS t1_r1, `skills`.`name` AS t1_r2, `skills`.`category` AS t1_r3, `skills`.`attribute_id` AS t1_r4, `skills`.`can_default` AS t1_r5, `skills`.`skill_group_id` AS t1_r6, `attributes`.`id` AS t2_r0, `attributes`.`category` AS t2_r1, `attributes`.`name` AS t2_r2, `attributes`.`default_rating` AS t2_r3, `attributes`.`description` AS t2_r4, `characters`.`id` AS t3_r0, `characters`.`street_name` AS t3_r1, `characters`.`real_name` AS t3_r2, `characters`.`type` AS t3_r3, `characters`.`born_on` AS t3_r4, `characters`.`alive` AS t3_r5, `characters`.`sex` AS t3_r6, `characters`.`description` AS t3_r7, `characters`.`nuyen` AS t3_r8, `characters`.`lifestyle` AS t3_r9, `characters`.`build_points` AS t3_r10, `characters`.`karma` AS t3_r11, `characters`.`current_karma` AS t3_r12, `characters`.`street_cred` AS t3_r13, `characters`.`notoriety` AS t3_r14, `characters`.`public_awareness` AS t3_r15, `characters`.`user_id` AS t3_r16, `characters`.`created_at` AS t3_r17, `characters`.`updated_at` AS t3_r18, `characters`.`metatype_id` AS t3_r19, `characters`.`physical_damage` AS t3_r20, `characters`.`mental_damage` AS t3_r21, `characters`.`essence` AS t3_r22, `attribute_ratings`.`id` AS t4_r0, `attribute_ratings`.`character_id` AS t4_r1, `attribute_ratings`.`attribute_id` AS t4_r2, `attribute_ratings`.`rating` AS t4_r3, `attribute_ratings`.`build_points` AS t4_r4 FROM `skill_ratings` LEFT OUTER JOIN `skills` ON `skills`.`id` = `skill_ratings`.`skill_id` LEFT OUTER JOIN `attributes` ON `attributes`.`id` = `skills`.`attribute_id` LEFT OUTER JOIN `characters` ON `characters`.`id` = `skill_ratings`.`character_id` AND `characters`.`type` = 'Character' LEFT OUTER JOIN `attribute_ratings` ON `attribute_ratings`.`character_id` = `characters`.`id` WHERE (`skill_ratings`.character_id = 1543492239 AND (`skills`.`type` = 'LanguageSkill'))
      } took 4.8ms
  } took 16.7ms
language_skill_ratings (18.0ms)
  QualityRating.calc {
      QualityRating.calc {
  SQL (0.4ms)  SELECT SUM(`quality_ratings`.`build_points`) AS sum_id FROM `quality_ratings` LEFT OUTER JOIN `qualities` ON `qualities`.`id` = `quality_ratings`.`quality_id` WHERE (`quality_ratings`.character_id = 1543492239)
      } took 1.2ms
  } took 1.8ms
quality_ratings (2.5ms)
9.5 KB in 16 ms with coderay