Upgrade to Pro — share decks privately, control downloads, hide ads and more …

MySQLで画像 を扱うメリット・デメリットと障害・解決事例/Advantages_and_d...

MySQLで画像 を扱うメリット・デメリットと障害・解決事例/Advantages_and_disadvantages_of_handling_images_with_MySQL_and_special_patterns

PHPカンファレンス福岡 2018 でお話ししました
「MySQLで画像 を扱うメリット・デメリットと障害・解決事例」
の登壇スライトです。

mamy1326

June 16, 2018
Tweet

More Decks by mamy1326

Other Decks in Programming

Transcript

  1. ࣗݾ঺հ Name ɿ·Έ΍ͳ͓͖ ॴଐɹ ɿInnovator Japan Inc. Twitterɿ@mamy1326ʢ·Έʔʣ - ීஈ͸PHPॻ͍ͯ·͢

    - 2017೥1݄ʹॳΊͯmy.cnfΛ৮Δ - 2017೥ MySQL͕झຯ - 2018೥ DNSͱωοτϫʔΫ͕झຯ
  2. mysql> show create table bukken\G *************************** 1. row *************************** Table:

    bukken Create Table: CREATE TABLE `bukken` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `gaikan_01` mediumblob NOT NULL, `gaikan_02` mediumblob, `gaikan_03` mediumblob, `gaikan_04` mediumblob, `gaikan_05` mediumblob, `gaikan_06` mediumblob, `gaikan_07` mediumblob, `gaikan_08` mediumblob, `gaikan_09` mediumblob, `gaikan_10` mediumblob, `madori_01` mediumblob NOT NULL, `naiso_01` mediumblob NOT NULL, `naiso_02` mediumblob, `naiso_03` mediumblob, `naiso_04` mediumblob, `naiso_05` mediumblob, `naiso_06` mediumblob, `naiso_07` mediumblob, `naiso_08` mediumblob, `naiso_09` mediumblob, `naiso_10` mediumblob, `syuhen_01` mediumblob NOT NULL, `syuhen_02` mediumblob, `syuhen_03` mediumblob, `syuhen_04` mediumblob, `syuhen_05` mediumblob, `syuhen_06` mediumblob, `syuhen_07` mediumblob, `syuhen_08` mediumblob, `syuhen_09` mediumblob, `syuhen_10` mediumblob, `panorama` mediumblob, `gaikan_s_01` mediumblob NOT NULL, `gaikan_s_02` mediumblob, `gaikan_s_03` mediumblob, `gaikan_s_04` mediumblob, `gaikan_s_05` mediumblob, `gaikan_s_06` mediumblob, `gaikan_s_07` mediumblob, `gaikan_s_08` mediumblob, `gaikan_s_09` mediumblob, `gaikan_s_10` mediumblob, `madori_s_01` mediumblob NOT NULL, `naiso_s_01` mediumblob NOT NULL, `naiso_s_02` mediumblob, `naiso_s_03` mediumblob, `naiso_s_04` mediumblob, `naiso_s_05` mediumblob, `naiso_s_06` mediumblob, `naiso_s_07` mediumblob, `naiso_s_08` mediumblob, `naiso_s_09` mediumblob, `naiso_s_10` mediumblob, `syuhen_s_01` mediumblob NOT NULL, `syuhen_s_02` mediumblob, `syuhen_s_03` mediumblob, `syuhen_s_04` mediumblob, `syuhen_s_05` mediumblob, `syuhen_s_06` mediumblob, `syuhen_s_07` mediumblob, `syuhen_s_08` mediumblob, `syuhen_s_09` mediumblob, `syuhen_s_10` mediumblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 1 row in set (0.00 sec)
  3. mysql> show create table bukken\G *************************** 1. row *************************** Table:

    bukken Create Table: CREATE TABLE `bukken` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, `gaikan_01` mediumblob NOT NULL, `gaikan_02` mediumblob, `gaikan_03` mediumblob, `gaikan_04` mediumblob, `gaikan_05` mediumblob, `gaikan_06` mediumblob, `gaikan_07` mediumblob, `gaikan_08` mediumblob, `gaikan_09` mediumblob, `gaikan_10` mediumblob, `madori_01` mediumblob NOT NULL, `naiso_01` mediumblob NOT NULL, `naiso_02` mediumblob, `naiso_03` mediumblob, `naiso_04` mediumblob, `naiso_05` mediumblob, `naiso_06` mediumblob, `naiso_07` mediumblob, `naiso_08` mediumblob, `naiso_09` mediumblob, `naiso_10` mediumblob, `syuhen_01` mediumblob NOT NULL, `syuhen_02` mediumblob, `syuhen_03` mediumblob, `syuhen_04` mediumblob, `syuhen_05` mediumblob, `syuhen_06` mediumblob, `syuhen_07` mediumblob, `syuhen_08` mediumblob, `syuhen_09` mediumblob, `syuhen_10` mediumblob, `panorama` mediumblob, `gaikan_s_01` mediumblob NOT NULL, `gaikan_s_02` mediumblob, `gaikan_s_03` mediumblob, `gaikan_s_04` mediumblob, `gaikan_s_05` mediumblob, `gaikan_s_06` mediumblob, `gaikan_s_07` mediumblob, `gaikan_s_08` mediumblob, `gaikan_s_09` mediumblob, `gaikan_s_10` mediumblob, `madori_s_01` mediumblob NOT NULL, `naiso_s_01` mediumblob NOT NULL, `naiso_s_02` mediumblob, `naiso_s_03` mediumblob, `naiso_s_04` mediumblob, `naiso_s_05` mediumblob, `naiso_s_06` mediumblob, `naiso_s_07` mediumblob, `naiso_s_08` mediumblob, `naiso_s_09` mediumblob, `naiso_s_10` mediumblob, `syuhen_s_01` mediumblob NOT NULL, `syuhen_s_02` mediumblob, `syuhen_s_03` mediumblob, `syuhen_s_04` mediumblob, `syuhen_s_05` mediumblob, `syuhen_s_06` mediumblob, `syuhen_s_07` mediumblob, `syuhen_s_08` mediumblob, `syuhen_s_09` mediumblob, `syuhen_s_10` mediumblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=28 DEFAULT CHARSET=utf8mb4 1 row in set (0.00 sec) ͑ʁ
  4. ςʔϒϧߏ੒  mysql> show create table bukken\G ****************** 1. row

    ****************** Table: bukken Create Table: CREATE TABLE `bukken` ( `id` int(10) NOT NULL AUTO_INCREMENT, `name` varchar(50) NOT NULL, ⾣ʮͪΌΜͱʯ֬ೝͯ͠ΈΔ
  5. ςʔϒϧߏ੒  `gaikan_01` mediumblob NOT NULL, `gaikan_02` mediumblob, `gaikan_03` mediumblob,

    `gaikan_04` mediumblob, `gaikan_05` mediumblob, `gaikan_06` mediumblob, `gaikan_07` mediumblob, `gaikan_08` mediumblob, `gaikan_09` mediumblob, `gaikan_10` mediumblob,
  6. ςʔϒϧߏ੒  `madori_01` mediumblob NOT NULL, `naiso_01` mediumblob NOT NULL,

    `naiso_02` mediumblob, `naiso_03` mediumblob, `naiso_04` mediumblob, `naiso_05` mediumblob, `naiso_06` mediumblob, `naiso_07` mediumblob, `naiso_08` mediumblob, `naiso_09` mediumblob, `naiso_10` mediumblob,
  7. ςʔϒϧߏ੒  `syuhen_01` mediumblob NOT NULL, `syuhen_02` mediumblob, `syuhen_03` mediumblob,

    `syuhen_04` mediumblob, `syuhen_05` mediumblob, `syuhen_06` mediumblob, `syuhen_07` mediumblob, `syuhen_08` mediumblob, `syuhen_09` mediumblob, `syuhen_10` mediumblob, `panorama` mediumblob,
  8. ςʔϒϧߏ੒  `gaikan_s_01` mediumblob NOT NULL, `gaikan_s_02` mediumblob, `gaikan_s_03` mediumblob,

    `gaikan_s_04` mediumblob, `gaikan_s_05` mediumblob, `gaikan_s_06` mediumblob, `gaikan_s_07` mediumblob, `gaikan_s_08` mediumblob, `gaikan_s_09` mediumblob, `gaikan_s_10` mediumblob,
  9. ςʔϒϧߏ੒  `madori_s_01` mediumblob NOT NULL, `naiso_s_01` mediumblob NOT NULL,

    `naiso_s_02` mediumblob, `naiso_s_03` mediumblob, `naiso_s_04` mediumblob, `naiso_s_05` mediumblob, `naiso_s_06` mediumblob, `naiso_s_07` mediumblob, `naiso_s_08` mediumblob, `naiso_s_09` mediumblob, `naiso_s_10` mediumblob,
  10. ςʔϒϧߏ੒  `syuhen_s_01` mediumblob NOT NULL, `syuhen_s_02` mediumblob, `syuhen_s_03` mediumblob,

    `syuhen_s_04` mediumblob, `syuhen_s_05` mediumblob, `syuhen_s_06` mediumblob, `syuhen_s_07` mediumblob, `syuhen_s_08` mediumblob, `syuhen_s_09` mediumblob, `syuhen_s_10` mediumblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7687528 DEFAULT CHARSET=utf8mb4 1 row in set (0.00 sec)
  11. ςʔϒϧߏ੒  `syuhen_s_01` mediumblob NOT NULL, `syuhen_s_02` mediumblob, `syuhen_s_03` mediumblob,

    `syuhen_s_04` mediumblob, `syuhen_s_05` mediumblob, `syuhen_s_06` mediumblob, `syuhen_s_07` mediumblob, `syuhen_s_08` mediumblob, `syuhen_s_09` mediumblob, `syuhen_s_10` mediumblob, PRIMARY KEY (`id`) ) ENGINE=InnoDB AUTO_INCREMENT=7687528 DEFAULT CHARSET=utf8mb4 1 row in set (0.00 sec) όΠφϦσʔλ อଘ༻ΧϥϜ