PHPerに知ってほしいRDBの事_その2.pdf

88f4e84b94fe07cddbd9e6479d689192?s=47 soudai sone
May 07, 2016
16k

 PHPerに知ってほしいRDBの事_その2.pdf

88f4e84b94fe07cddbd9e6479d689192?s=128

soudai sone

May 07, 2016
Tweet

Transcript

  1. PHPerʹ஌ͬͯ΄͍͠RDBͷࣄ Version 2.0 1)1ΧϯϑΝϨϯεˏ෱Ԭ

  2. What is it? σʔλϕʔεͷण໋͸ ΞϓϦέʔγϣϯΑΓ΋௕͍

  3. What is it? ͦΜͳ௕͍෇͖߹͍ʹͳΔσʔλϕʔε ͷେ੾ͳࣄΛ͓఻͑͠·͢

  4. What is it? σʔλϕʔεͰ େ੾ͳ͜ͱ ΞϓϦέʔγϣϯͰ େ੾ͳ͜ͱ

  5. What is it? ΞϓϦέʔγϣϯͰ େ੾ͳ͜ͱ σʔλϕʔεͰ େ੾ͳ͜ͱ ͜͜ͷ࿩Λ͠·͢

  6. What is it? ର৅ͷσʔλϕʔειϑτ΢ΣΞ

  7. What is it? PostgreSQL 9.5ͱMySQL 5.6(InnoDB)ʹݶΔ ଞͷRDBͷ࿩͸͠·ͤΜ

  8. What is it? ৽ػೳͷ࿩ ↓ ֤σʔλϕʔεͷίϛϡχςΟʹࢀՃ͠Α͏ https://mysql-casual-slackin.herokuapp.com/ https://postgresql-hackers-jp.herokuapp.com/ େ੾ͳ࿩͚ͩͲࠓ೔͸͠ͳ͍͜ͱ

  9. What is it? ࠓ೔ͷ࿩͢Δ͜ͱ

  10. What is it? RDBΛ࢖͏্Ͱ͓͍֮͑ͯͯཉ͍͜͠ͱ

  11. What is it? RDBΛ࢖͏্Ͱ͓͍֮͑ͯͯཉ͍͜͠ͱ ↓ جૅతͳ͜ͱͰ͙࣮͢ફͰ͖Δ͜ͱ

  12. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  13. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  14. ࣗݾ঺հ ໊લɿીࠜɹ૖େʢͦͶɹ͚ͨͱ΋ʣ ೥ྸɿ31ࡀʢࡾਓͷࢠڙ͕͍·͢ʣ ৬ۀɿגࣜձࣾɹΦϛΧϨʢCTOʣ ॴଐɿ೔ຊPostgreSQLϢʔβձ ɹɹɹதࠃࢧ෦ ࢧ෦௕ ɹɹٕज़తʹ͸LLܥݴޠͱ͔RDB͕޷͖Ͱ͢

  15. What is it? d

  16. ࣗݾ঺հ ໊લɿીࠜɹ૖େʢͦͶɹ͚ͨͱ΋ʣ ೥ྸɿ31ࡀʢࡾਓͷࢠڙ͕͍·͢ʣ ৬ۀɿגࣜձࣾɹΦϛΧϨʢCTOʣ ॴଐɿ೔ຊPostgreSQLϢʔβձ ɹɹɹதࠃࢧ෦ ࢧ෦௕ ɹɹٕज़తʹ͸LLܥݴޠͱ͔RDB͕޷͖Ͱ͢

  17. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  18. ݕࡧͱINDEX #5SFF*/%&9

  19. ݕࡧͱINDEX #5SFF*/%&9 3%#ͷ*/%&9͸جຊతʹ͜Ε ʢ(*/΍35SFFʹ͍ͭͯ͸ࠓճ৮Εͳ͍ʣ

  20. ݕࡧͱINDEX Ҿ༻ݩɿIUUQTKBXJLJQFEJBPSHXJLJ##&$" ΢ΟΩϖσΟΞʮ# ໦ʯ

  21. ݕࡧͱINDEX w 8)&3&۟Ͱ࢖͏ w (3061#:۟Ͱ΋࢖͏ w 03%&3#:۟Ͱ΋࢖͏

  22. ݕࡧͱINDEX w 8)&3&۟Ͱ࢖͏ w (3061#:۟Ͱ΋࢖͏ w 03%&3#:۟Ͱ΋࢖͏ ݕࡧશൠͰ࢖͏

  23. ݕࡧͱINDEX w 8)&3&۟Ͱ࢖͏ w (3061#:۟Ͱ΋࢖͏ w 03%&3#:۟Ͱ΋࢖͏ ݕࡧશൠͰ࢖͏ ͔͠͠.Z42-͸ͭͷ5"#-&Ͱ ͔ͭ͠*/%&9Λ࢖Θͳ͍

  24. ݕࡧͱINDEX */%&9ΛޮՌతʹ࢖͏ʹ͸ w ॏෳ͕গͳ͍΄͏͕ྑ͍ w ݁Ռ͕গͳ͍΄͏͕ྑ͍

  25. ݕࡧͱINDEX */%&9ΛޮՌతʹ࢖͏ʹ͸ w ॏෳ͕গͳ͍΄͏͕ྑ͍ w ݁Ռ͕গͳ͍΄͏͕ྑ͍ 6OJRVF͕ཧ૝ ॏෳ͕ଟ͍৔߹ɺ*/%&9ͷҙຯ͕ബΕΔ Α͋͘Δͷ͸%&-&5&@'-"(

  26. ݕࡧͱINDEX */%&9ΛޮՌతʹ࢖͏ʹ͸ w ॏෳ͕গͳ͍΄͏͕ྑ͍ w ݁Ռ͕গͳ͍΄͏͕ྑ͍ ࢀরͷ5"#-&ͷશͯΛදࣔ͢ΔͳΒݩ͔Βશ ෦ݟͨ΄͏͕ྑ͍ શମͷʙ·Ͱ͕*/%&9ར༻ͷ໨҆

  27. ݕࡧͱINDEX */%&9Λ੍͢Δऀ͸ݕࡧΛ੍͢Δ

  28. ݕࡧͱINDEX ࣮ߦܭըΛݟΔ

  29. ݕࡧͱINDEX &91-"*/Ͱॏཁͳ͜ͱ w ૝ఆ͢ΔϨίʔυʹ࣮σʔλΛ͋ΘͤΔ w ౷ܭ৘ใΛ࠷৽ʹ͢Δ w ࣮ߦ݁Ռ͕ਖ਼͍͜͠ͱΛ֬ೝ͢Δ

  30. ݕࡧͱINDEX &91-"*/Ͱॏཁͳ͜ͱ w ૝ఆ͢ΔϨίʔυʹ࣮σʔλΛ͋ΘͤΔ w ౷ܭ৘ใΛ࠷৽ʹ͢Δ w ࣮ߦ݁Ռ͕ਖ਼͍͜͠ͱΛ֬ೝ͢Δ σʔλྔʹΑ࣮ͬͯߦܭը͕มΘΔ͜ͱ΋ଟ͍ ࣮ࡍΑΓগͳ͍σʔλͰ֬ೝͯ͠΋ҙຯ͕ແ͍

  31. ݕࡧͱINDEX &91-"*/Ͱॏཁͳ͜ͱ w ૝ఆ͢ΔϨίʔυʹ࣮σʔλΛ͋ΘͤΔ w ౷ܭ৘ใΛ࠷৽ʹ͢Δ w ࣮ߦ݁Ռ͕ਖ਼͍͜͠ͱΛ֬ೝ͢Δ σʔλʹେྔͷ௥Ճɾ࡟আɾมߋ͕͋Δͱ౷ܭ৘ใ͕ෆਖ਼֬ʹͳΔ "/"-:;&5"#-&Ͱ౷ܭ৘ใΛߋ৽͔ͯ͠Β&91-"*/ʂʂ

  32. ݕࡧͱINDEX &91-"*/Ͱॏཁͳ͜ͱ w ૝ఆ͢ΔϨίʔυʹ࣮σʔλΛ͋ΘͤΔ w ౷ܭ৘ใΛ࠷৽ʹ͢Δ w ࣮ߦ݁Ռ͕ਖ਼͍͜͠ͱΛ֬ೝ͢Δ ࣮ߦܭըͰߴ଎Խͯ͠΋࣮ߦ݁Ռ͕มΘΔͱҙຯ͕ແ͍ ࠷ऴతʹຊ൪Ͱ֬ೝ͔ͯ͠ΒϦϦʔε͢Δ͜ͱ

  33. ݕࡧͱINDEX &91-"*/ͷ·ͱΊ w ެࣜυΩϡϝϯτΛಡ΋͏ UZQFͳͲ͸छྨ͕୔ࢁ͋Δ 
 IUUQTEFWNZTRMDPNEPDSFGNBOKBFYQMBJOPVUQVUIUNM
 IUUQTXXXQPTUHSFTRMKQEPDVNFOUIUNMTRMFYQMBJOIUNM w ૉৼΓେࣄ

  34. ݕࡧͱINDEX .Z42-8PSLCFODI QHBENJO

  35. ࣮ߦܭը CREATE TABLE `demo`.`users` ( `id` INT NOT NULL AUTO_INCREMENT

    COMMENT '', `name` VARCHAR(45) NOT NULL COMMENT '', `age` INT NOT NULL COMMENT '', `created` DATETIME NOT NULL DEFAULT NOW () COMMENT '', PRIMARY KEY (`id`) COMMENT '' ); ——શ݅Λબ୒͢ΔͷͰςʔϒϧεΩϟϯ SELECT * FROM demo.users; ——PRIMARY KEYʢINDEXʣΛར༻ͨ͠ྫ SELECT * FROM demo.users WHERE id > 100; ——INDEX͕ແ͍ͷͰςʔϒϧεΩϟϯ SELECT * FROM demo.users WHERE age > 20;
  36. MySQL

  37. MySQL

  38. MySQL ૬ؔαϒΫΤϦ

  39. ૬ؔαϒΫΤϦ ——஗͍૬ؔαϒΫΤϦ SELECT * FROM users WHERE age IN (SELECT

    age FROM users WHERE id BETWEEN 10 AND 100000)
  40. MySQL

  41. MySQL .Z42-͔Β."5&3*"-*;&%ʹ มΘΓɺ+0*/ͷΑ͏ͳڍಈʹͳͬͨ ੲΑΓૣ͘ͳͬͨ

  42. ૬ؔαϒΫΤϦ ——INDEX͕ར༻Ͱ͖Ε͹૬ؔαϒΫΤϦͰ΋଎͍ SELECT * FROM users WHERE created = '2016-02-27

    04:31:32' AND id IN (SELECT id FROM users WHERE id BETWEEN 10 AND 100000)
  43. MySQL

  44. MySQL ૬ؔαϒΫΤϦ͸஗͍ ৔߹͕ଟ͍

  45. MySQL ૬ؔαϒΫΤϦ͸஗͍ ˣ +0*/ʹॻ͖׵͑Δ

  46. JOIN SELECT * FROM users INNER JOIN users AS tmp

    ON tmp.id = users.id AND tmp.id BETWEEN 10 AND 100000 WHERE users.created = '2016-02-27 04:31:32'
  47. MySQL

  48. MySQL +0*/͸ֻ͚ࢉ

  49. MySQL +0*/͸ֻ͚ࢉ ˣ ߦ☓ߦ͸ߦ

  50. MySQL .Z42-ʹ͸ +0*/ͷΞϧΰϦζϜ͸Ұ͔ͭ͠ͳ͍

  51. MySQL .Z42-ʹ͸ +0*/ͷΞϧΰϦζϜ͸Ұ͔ͭ͠ͳ͍ ܾͯ͠ಘҙͳΘ͚Ͱ͸ແ͍ +0*/͸ϋΠίετͳΫΤϦ

  52. MySQL w ग़དྷΔ͚ͩখ͔ͯ͘͞͠Β+0*/ w ෆཁͳ+0*/͸ආ͚Δ w */%&9Λར༻ͨ͠+0*/Λ͢Δ

  53. MySQL γϯϓϧɾߴ଎

  54. MySQL γϯϓϧɾߴ଎ ˣ ೉͍͠ࣄΛ͠ͳ͍ ઃܭྗ͕ॏཁ

  55. PostgreSQL w*/%&9͸ෳ਺ݸ࢖͑Δ wͦ΋ͦ΋*/%&9ͷछྨ͕୔ࢁ͋Δ w૬ؔαϒΫΤϦ΋଎͍ w+0*/ͷΞϧΰϦζϜ΋ෳ਺͋Δ

  56. PostgreSQL w*/%&9͸ෳ਺ݸ࢖͑Δ wͦ΋ͦ΋*/%&9ͷछྨ͕୔ࢁ͋Δ w૬ؔαϒΫΤϦ΋଎͍ w+0*/ͷΞϧΰϦζϜ΋ෳ਺͋Δ ͭͷΫΤϦ಺Ͱෳ਺࢖͑Δ

  57. PostgreSQL w*/%&9͸ෳ਺ݸ࢖͑Δ wͦ΋ͦ΋*/%&9ͷछྨ͕୔ࢁ͋Δ w૬ؔαϒΫΤϦ΋଎͍ w+0*/ͷΞϧΰϦζϜ΋ෳ਺͋Δ #USFFɺ(*/ɺࣜ*/%&9ͳͲγʔϯʹ߹Θͤͯ ෳ਺ͷ*/%&9Λར༻Ͱ͖Δ

  58. PostgreSQL w*/%&9͸ෳ਺ݸ࢖͑Δ wͦ΋ͦ΋*/%&9ͷछྨ͕୔ࢁ͋Δ w૬ؔαϒΫΤϦ΋଎͍ w+0*/ͷΞϧΰϦζϜ΋ෳ਺͋Δ ࢖͑Δ42-ͷߏจ΋ଟ͍ ྫ͑͹΢Πϯυ΢ؔ਺ͳͲ

  59. PostgreSQL w*/%&9͸ෳ਺ݸ࢖͑Δ wͦ΋ͦ΋*/%&9ͷछྨ͕୔ࢁ͋Δ w૬ؔαϒΫΤϦ΋଎͍ w+0*/ͷΞϧΰϦζϜ΋ෳ਺͋Δ /FTUFE-PPQ+PJO 4PSU.FSHF+PJO )BTI+PJO

  60. PostgreSQL

  61. PostgreSQL ͜ͷຊ͕͘͢͝ྑ͍ ͔͠͠ͷ࿩ IUUQXXXBNB[PODPKQ಺෦ߏ଄͔ΒֶͿ1PTUHSF42-ઃܭɾӡ༻ܭըͷమଇ4PGUXBSF%FTJHOQMVTEQ

  62. ෳ਺ར༻ͨ͠INDEX CREATE TABLE public.users ( id integer NOT NULL DEFAULT

    nextval('users_id_seq'::regclass), name text NOT NULL, age integer NOT NULL, created timestamp without time zone NOT NULL DEFAULT now(), CONSTRAINT users_pkey PRIMARY KEY (id)); CREATE INDEX users_created_idx ON public.users USING tree (created); ——idͱcreatedͷINDEXΛར༻͢Δ SELECT * FROM users WHERE id < 100 AND created < '2016-02-27 05:41:28';
  63. PostgreSQL

  64. ࣜINDEX ——ࣜINDEXΛ࡞੒ CREATE INDEX test_idx ON users (substr(name,10,12)); ——ࣜͷ݁ՌͰINDEX͕ޮ͘ SELECT

    name FROM users WHERE substr(name,10,12) = '10'
  65. PostgreSQL

  66. ૬ؔαϒΫΤϦ SELECT * FROM users WHERE age IN (SELECT age

    FROM users WHERE id BETWEEN 10 AND 100000)
  67. PostgreSQL

  68. ૬ؔαϒΫΤϦ ——σϞͰINDEXΛ࢖ͬͯ͘Εͳ͍ͷͰINDEXΛ༏ઌతʹར༻͢ΔΑ͏ʹࢦఆ SET ENABLE_SEQSCAN=OFF; SELECT * FROM users WHERE id

    IN (SELECT id FROM users WHERE id BETWEEN 10 AND 100000)
  69. PostgreSQL

  70. PostgreSQL 1PTUHSF42-ͷ૬ؔαϒΫΤϦ͸ ൺֱత଎͍

  71. PostgreSQL ෳࡶͳूܭ͸ಘҙ ˣ Ͱ΋3%#ͷجຊ͸.Z42-ͱҰॹ

  72. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  73. ͱΓ͋͑ͣ࡟আϑϥά IUUQXXXTMJEFTIBSFOFUU@XBEBSPOTBLVDBTVBM

  74. ͱΓ͋͑ͣ࡟আϑϥά ͜ΜͳΧϥϜ໊Λ ࡞ͬͨ͜ͱ͋Γ·ͤΜ͔ʁ

  75. ͱΓ͋͑ͣ࡟আϑϥά IPHF@EFMFUF@qBH

  76. ͱΓ͋͑ͣ࡟আϑϥά ձһ࡟আϑϥάʜ ސ٬࡟আϑϥάʜ IPHFσʔλ࡟আϑϥάʜ

  77. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আͱݴ͏໊ͷҋ

  78. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আͷཧ༝

  79. ͱΓ͋͑ͣ࡟আϑϥά w ΤϯυϢʔβ͔Βݟ͑ͳ͍͕ͨ͘͠σʔλ͸ফͨ͘͠ͳ͍ w ࡟আͨ͠σʔλΛݕࡧ͍ͨ͠ w σʔλΛফͣ͞ʹϩάʹ࢒͍ͨ͠ w ޡͬͨૢ࡞Λͳ͔ͬͨ͜ͱʹ͍ͨ͠ɺ௚͙ʹݩʹ໭͍ͨ͠

  80. ͱΓ͋͑ͣ࡟আϑϥά ͦͯ͠ੜ·ΕΔ%&-&5&@'-"(

  81. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আ͸ͳͥμϝͳͷ͔ʁ

  82. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আͷσϝϦοτ

  83. ͱΓ͋͑ͣ࡟আϑϥά w ੵΈॏͳΔ8)&3&EFMFUF@qBH w 6OJRVF੍໿͕࢖͑ͳ͘ͳΔ w ෳࡶͳදࣔ৚݅ʢ2VFSZʣͷݪҼ

  84. ͱΓ͋͑ͣ࡟আϑϥά w ੵΈॏͳΔ8)&3&EFMFUF@qBH w 6OJRVF੍໿͕࢖͑ͳ͘ͳΔ w ෳࡶͳදࣔ৚݅ʢ2VFSZʣͷݪҼ

  85. ੵΈॏͳΔWHERE۟ ϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH 8)&3& CMPHEFMFUF@qBH

  86. ੵΈॏͳΔWHERE۟ ϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH 8)&3& CMPHEFMFUF@qBH ϒϩάͷ࡟আϑϥάΛݟΔ

  87. ੵΈॏͳΔWHERE۟ ϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH 8)&3& CMPHEFMFUF@qBH ϒϩάͷ࡟আϑϥάΛݟΔ

    ߋ৽ऀΞΧ΢ϯτ͕࡟আ͞ΕͯͨΒʁ
  88. ੵΈॏͳΔWHERE۟ ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    8)&3& CMPHEFMFUF@qBH
  89. ੵΈॏͳΔWHERE۟ ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    8)&3& CMPHEFMFUF@qBH Ϣʔβͷ࡟আϑϥάΛݟΔ
  90. ੵΈॏͳΔWHERE۟ ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    8)&3& CMPHEFMFUF@qBH Ϣʔβͷ࡟আϑϥάΛݟΔ ॴଐ͕࡟আ͞ΕͯͨΒʁ
  91. ੵΈॏͳΔWHERE۟ ༗ޮͳॴଐͷ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    *//&3+0*/DVTUPNFST 0/DVTUPNFSTJEVTFSTDVTUPNFS@JE "/%DVTUPNFSTEFMFUF@qBH 8)&3& CMPHEFMFUF@qBH
  92. ੵΈॏͳΔWHERE۟ ༗ޮͳॴଐͷ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    *//&3+0*/DVTUPNFST 0/DVTUPNFSTJEVTFSTDVTUPNFS@JE "/%DVTUPNFSTEFMFUF@qBH 8)&3& CMPHEFMFUF@qBH +0*/͕ͲΜͲΜੵΈॏͳΔ
  93. ੵΈॏͳΔWHERE۟ ༗ޮͳॴଐͷ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    *//&3+0*/DVTUPNFST 0/DVTUPNFSTJEVTFSTDVTUPNFS@JE "/%DVTUPNFSTEFMFUF@qBH 8)&3& CMPHEFMFUF@qBH +0*/͕ͲΜͲΜੵΈॏͳΔ 2VFSZ͕ϘτϧωοΫʹ
  94. ͱΓ͋͑ͣ࡟আϑϥά 2VFSZͷෳࡶ౓ʹର͢Δରࡦ

  95. ͱΓ͋͑ͣ࡟আϑϥά 2VFSZͷෳࡶ౓ʹର͢Δରࡦ ˣ ༗ޮͳσʔλͷ7JFXΛ࡞Δ

  96. ͱΓ͋͑ͣ࡟আϑϥά 2VFSZͷෳࡶ౓ʹର͢Δରࡦ ˣ ༗ޮͳσʔλͷ7JFXΛ࡞Δ 2VFSZͷߴ଎Խʹ͸ͳΒͳ͍

  97. ͱΓ͋͑ͣ࡟আϑϥά શͯͷ*/%&9ͷηΧϯμϦʹ %&-&5&@'-"(ΛೖΕΔඞཁ͕͋Δ

  98. ͱΓ͋͑ͣ࡟আϑϥά શͯͷ*/%&9ͷηΧϯμϦʹ %&-&5&@'-"(ΛೖΕΔඞཁ͕͋Δ .Z42-͸*/%&9Λͭͷ5"#-&Ͱ͔ͭ͠࢖Θͳ͍ 8)&3&EFMFUF@qBH͸ΧʔσΟφϦςΟ͕ภΔ

  99. ͱΓ͋͑ͣ࡟আϑϥά શͯͷ*/%&9ͷηΧϯμϦʹ %&-&5&@'-"(ΛೖΕΔඞཁ͕͋Δ 1PTUHSF42-΋*/%&9Λෳ਺ޮ͔ͤΔ 2VFSZΛॻ͘ͷ͕େม ΧʔσΟφϦςΟͷ໰୊͸ಉ༷

  100. ͱΓ͋͑ͣ࡟আϑϥά w ੵΈॏͳΔ8)&3&EFMFUF@qBH w 6OJRVF੍໿͕࢖͑ͳ͘ͳΔ w ෳࡶͳදࣔ৚݅ʢ2VFSZʣͷݪҼ

  101. ͱΓ͋͑ͣ࡟আϑϥά w ੵΈॏͳΔ8)&3&EFMFUF@qBH w 6OJRVF੍໿͕࢖͑ͳ͘ͳΔ w ෳࡶͳදࣔ৚݅ʢ2VFSZʣͷݪҼ ͭ·Γ֎෦,FZ੍໿΋ࢮ͵

  102. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP  
  103. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP  
  104. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP   ಉ͡Ϣʔβ໊͕͍ΔͷͰ 6OJRVF੍໿Ͱ͖ͳ͍
  105. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP   ಉ͡Ϣʔβ໊͕͍ΔͷͰ 6OJRVF੍໿Ͱ͖ͳ͍ ΋ͪΖΜ֎෦Ωʔ੍໿΋Ͱ͖ͳ͍
  106. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP   αϩήʔτΩʔͰ֎෦Ωʔ੍໿ͨ͠৔߹͸ ؔ࿈ͨ͠σʔλ͸ผਓѻ͍ʹͳΔ
  107. ͱΓ͋͑ͣ࡟আϑϥά JE OBNF BHF EFMFUFE  TPVEBJ   

    TPVEBJ    TPOF    UBLFUPNP   αϩήʔτΩʔͰ֎෦Ωʔ੍໿ͨ͠৔߹͸ ؔ࿈ͨ͠σʔλ͸ผਓѻ͍ʹͳΔ φνϡϥϧΩʔͷ৔߹͸ࢮ͵
  108. ͱΓ͋͑ͣ࡟আϑϥά ֎෦Ωʔ੍໿͕ࢮ͵

  109. ͱΓ͋͑ͣ࡟আϑϥά ֎෦Ωʔ੍໿͕ࢮ͵ ˣ ςʔϒϧͷؔ࿈ੑͷ୲อ͕ࢮ͵

  110. ͱΓ͋͑ͣ࡟আϑϥά σʔλͷෆ੔߹Λ๷͛ͳ͍

  111. ͱΓ͋͑ͣ࡟আϑϥά σʔλͷෆ੔߹Λ๷͛ͳ͍ ˣ όάͷԹচʹͳΔ

  112. ͱΓ͋͑ͣ࡟আϑϥά σʔλͷෆ੔߹Λ๷͛ͳ͍ ˣ ώϡʔϚϯΤϥʔ΋๷͛ͳ͍

  113. ͱΓ͋͑ͣ࡟আϑϥά σʔλͷෆ੔߹͕ى͖ͨΒʁ

  114. ͱΓ͋͑ͣ࡟আϑϥά σʔλͷෆ੔߹͕ى͖ͨΒʁ ˣ ݩʹ໭͢ͷ͸ࢸ೉ͷٕ

  115. ͱΓ͋͑ͣ࡟আϑϥά w ੵΈॏͳΔ8)&3&EFMFUF@qBH w 6OJRVF੍໿͕࢖͑ͳ͘ͳΔ w ෳࡶͳදࣔ৚݅ʢ2VFSZʣͷݪҼ

  116. ͱΓ͋͑ͣ࡟আϑϥά ਖ਼͍͠σʔλΛ දࣔͤ͞Δ৚͕݅ଟ͍

  117. ੵΈॏͳΔWHERE۟ ༗ޮͳॴଐͷ༗ޮͳΞΧ΢ϯτͷϒϩάΛऔ͖͍ͬͯͨ৔߹ 4&-&$5   '30. CMPH *//&3+0*/VTFST 0/VTFSTJECMPHVTFS@JE "/%VTFSTEFMFUF@qBH

    *//&3+0*/DVTUPNFST 0/DVTUPNFSTJEVTFSTDVTUPNFS@JE "/%DVTUPNFSTEFMFUF@qBH 8)&3& CMPHEFMFUF@qBH දࣔͤ͞ΔͨΊʹ ͭͷςʔϒϧ͕ؔ܎͍ͯ͠Δ
  118. ͱΓ͋͑ͣ࡟আϑϥά ͭͷσʔλΛऔΔͨΊʹ ؔ܎͢Δ5"#-&͕ଟ͗͢Δ

  119. ͱΓ͋͑ͣ࡟আϑϥά ʮ͋ͷσʔλऔΔʹ͸˓˓ͱ☓☓ͱ ˚˚Λ+0*/ͯ͠8)&3&ͯ͠4&-&$5 ۟ʹ"4Ͱผ໊Λ෇͚ͯʜʯ Έ͍ͨͳࣄ͕සൃ͢Δ

  120. ͱΓ͋͑ͣ࡟আϑϥά ࢓༷มߋͷ࣌ͷӨڹൣғ͕޿͍

  121. ͱΓ͋͑ͣ࡟আϑϥά ࢓༷มߋͷ࣌ͷӨڹൣғ͕޿͍ ˣ ͭ·ΓόάͷԹচʹͳΔ

  122. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আ͸࢖Θͳ͍΄͏͕ྑ͍

  123. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আ͸࢖Θͳ͍΄͏͕ྑ͍ ˣ 5"#-&ʹঢ়ଶΛ࣋ͨͤͳ͍

  124. ͱΓ͋͑ͣ࡟আϑϥά ࿦ཧ࡟আ͸࢖Θͳ͍΄͏͕ྑ͍ ˣ 5"#-&ʹঢ়ଶΛ࣋ͨͤͳ͍ ϦϨʔγϣφϧϞσϧͰදݱ͢Δ

  125. ͱΓ͋͑ͣ࡟আϑϥά ॲํᝦ

  126. ͱΓ͋͑ͣ࡟আϑϥά ༗ޮͳσʔλͷΈΛ࢒͢

  127. ͱΓ͋͑ͣ࡟আϑϥά ༗ޮͳσʔλͷΈΛ࢒͢ ˣ ྫ͑͹࡟আࡁΈ5"#-&Λ࡞Δ

  128. ͱΓ͋͑ͣ࡟আϑϥά EFMFUFE@VTFST VTFST

  129. ͱΓ͋͑ͣ࡟আϑϥά EFMFUFE@VTFST VTFST TPVEBJ TPOF UBLFUPNP

  130. ͱΓ͋͑ͣ࡟আϑϥά EFMFUFE@VTFST VTFST TPVEBJ TPOF UBLFUPNP ࡟আ %&-&5&จ

  131. ͱΓ͋͑ͣ࡟আϑϥά EFMFUFE@VTFST VTFST TPVEBJ TPOF UBLFUPNP TPVEBJ τϦΨʔͰҠ͢

  132. ͱΓ͋͑ͣ࡟আϑϥά EFMFUFE@VTFST VTFST TPOF UBLFUPNP TPVEBJ ςʔϒϧʹ͸࣮ࡍͷσʔλͷΈ͕࢒Δ

  133. ͱΓ͋͑ͣ࡟আϑϥά ஫ҙ఺

  134. ͱΓ͋͑ͣ࡟আϑϥά ஫ҙ఺ ˣ τϦΨʔ͸࢓༷มߋʹऑ͍

  135. ͱΓ͋͑ͣ࡟আϑϥά ஫ҙ఺ ˣ τϦΨʔ͸࢓༷มߋʹऑ͍ ྫ͑͹"-5&3จͰΧϥϜΛ૿΍͢ͱ τϦΨʔ͕ࢮ͵

  136. ͱΓ͋͑ͣ࡟আϑϥά έʔεόΠέʔεͰख๏͸બͿ͜ͱ

  137. ͱΓ͋͑ͣ࡟আϑϥά έʔεόΠέʔεͰख๏͸બͿ͜ͱ ˣ ࿦ཧ࡟আ͸࢖Θͳ͍

  138. ͱΓ͋͑ͣ࡟আϑϥά ؔ࿈ͨ͠ςʔϒϧ͸ʁ

  139. ͱΓ͋͑ͣ࡟আϑϥά ؔ࿈ͨ͠ςʔϒϧ͸ʁ ˣ ඞཁͳΒ࡟আࡁΈ5"#-&Λ࡞Δ ෆཁͳΒ%&-&5&͢Δ

  140. ͱΓ͋͑ͣ࡟আϑϥά ؔ࿈ͨ͠ςʔϒϧ͸ʁ ˣ ඞཁͳΒ࡟আࡁΈ5"#-&Λ࡞Δ ෆཁͳΒ%&-&5&͢Δ ֎෦Ωʔ੍໿͕࢖͑Ε͹$"4$"%&΋ग़དྷΔ

  141. ͱΓ͋͑ͣ࡟আϑϥά ؔ࿈ͨ͠ςʔϒϧ͸ʁ ˣ ඞཁͳΒ࡟আࡁΈ5"#-&Λ࡞Δ ෆཁͳΒ%&-&5&͢Δ ֎෦Ωʔ੍໿͕࢖͑Ε͹$"4$"%&΋ग़དྷΔ ࣄ࣮ͷΈΛอଘ͢Δ

  142. ͱΓ͋͑ͣ࡟আϑϥά wϢʔβͷঢ়ଶ TUBUVTΧϥϜʣ w՝ۚঢ়ଶʢ༩৴ɺ੥ٻࡁΈʣ wΧʔτ৘ใʢΧΰͷதɺߪೖࡁΈʣ ྨࣅྫ

  143. ͱΓ͋͑ͣ࡟আϑϥά %#ʹঢ়ଶΛ࣋ͨͤΔͷ͸ةͳ͍

  144. ͱΓ͋͑ͣ࡟আϑϥά %#ʹঢ়ଶΛ࣋ͨͤΔͷ͸ةͳ͍ ˣ %#ʹ͸ࣄ࣮ͷΈΛอଘ͢Δ

  145. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  146. ϚςϦΞϥΠζυϏϡʔ 1PTUHSF42-ʹ͸ ϚςϦΞϥΠζυɾϏϡʔ͕͋Δ

  147. ϚςϦΞϥΠζυϏϡʔ ͳ͓ɺ.Z42-ʹ͸ͳ͍

  148. ϚςϦΞϥΠζυϏϡʔ ϚςϏϡʔͱ͸ʁ 7JFXΛ࣮ମԽͤ͞Δ ͭ·ΓΫΤϦͷ݁Ռͷ5"#-&Λ࡞Δ

  149. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ

  150. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ

  151. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ $3&"5&

  152. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ूܭ݁Ռ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ $3&"5&

  153. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ूܭ݁Ռ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ ूܭ݁ՌΛࢀর͢ΔͷͰߴ଎Ͱγϯϓϧʂʂ

  154. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ूܭ݁Ռ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ ՝ۚ

  155. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ूܭ݁Ռ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ ϦϑϨογϡ ՝ۚ

  156. ϚςϦΞϥΠζυϏϡʔ ूܭࡁΈද ՝ۚMPH ՝ۚ ूܭ݁Ռ ܭࢉ݁ՌΛϚςϏϡʔʹ͢Δ ՝ۚ ϦϑϨογϡ ՝ۚ ϦϑϨογϡ͠ͳ͍ͱूܭ݁Ռ͸มΘΒͳ͍

  157. ϚςϦΞϥΠζυϏϡʔ wෳࡶͳςʔϒϧΛγϯϓϧʹ w஗͍ΫΤϦΛߴ଎ʹ w*/%&9νϡʔχϯά΋Մೳ ϝϦοτ

  158. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ

  159. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ

  160. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ ࣮ମΛ࣋ͭͷͰσʔλϑΝΠϧ͕࡞੒͞ΕΔ ࡞ͬͨ෼͚ͩσΟεΫεϖʔεΛѹഭ͢Δ

  161. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ ࣮ମΛ࣋ͭͷͰσʔλϑΝΠϧ͕࡞੒͞ΕΔ ࡞ͬͨ෼͚ͩσΟεΫεϖʔεΛѹഭ͢Δ ࢀরݩͷςʔϒϧͷ૿Ճͱ߹ΘͤͯϚςϏϡʔ͕૿͑Ε͹ ࢦ਺తʹσΟεΫεϖʔεͷ࢖༻ྔ͕૿͑Δ

  162. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ ߋ৽͕ࣦഊͨ࣌͠ͷॲཧΛ๨Εͣʹʂ

  163. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ

  164. ϚςϦΞϥΠζυϏϡʔ wදྖҬΛ࢖͏ wϦϑϨογϡ͕ඞཁ wϦϑϨογϡͷίετ͕ߴ͍ σϝϦοτ 1PTUHSF42-ʹ͸ࠩ෼ߋ৽͸ແ͍ ˠσʔλ͕ΫΤϦͷ࣮ߦ଎౓͕஗͚Ε͹ߋ৽΋஗͍

  165. ϚςϦΞϥΠζυϏϡʔ ͦΜͳσϝϦοτΛഎෛͬͯ΋ ૉ੖Β͍͠ޮՌ͕ϚςϏϡʔ͸͋Δ

  166. ϚςϦΞϥΠζυϏϡʔ ϚςϏϡʔͰ࡟আϑϥάͷ ༗ޮσʔλ7JFXΛ࡞Δ

  167. ϚςϦΞϥΠζυϏϡʔ ϚςϏϡʔͰ༗ޮσʔλ7JFXΛ࡞Δ

  168. ϚςϦΞϥΠζυϏϡʔ ϚςϏϡʔͰ༗ޮσʔλ7JFXΛ࡞Δ ˣ ߴ଎Ͱ2VFSZ΋γϯϓϧ

  169. ϚςϦΞϥΠζυϏϡʔ ϚςϏϡʔͰ༗ޮσʔλ7JFXΛ࡞Δ ˣ ߴ଎Ͱ2VFSZ΋γϯϓϧ 4&-&$5 '30.BDUJWF@CMPH

  170. ϚςϦΞϥΠζυϏϡʔ ߋ৽ͨ͠ΒϚςϏϡʔΛߋ৽ ˣ DVTUPNFSTͰ΋VTFSTͰ΋CMPHͰ΋ ߋ৽͕͋Ε͹ϚςϏϡʔ΋ߋ৽ ˞஫ҙ఺ 3&'3&4)."5&3*"-*;&%7*&8͕සൃ͢Δͱ 4FSWFSͷϦιʔεΛ৯͏ 1PTUHSF42-ʹ͸·ͩࠩ෼ߋ৽͕ແ͍ͨΊ

  171. ϚςϦΞϥΠζυϏϡʔ ͝ར༻͸ܭըతʹ

  172. ͋͐͡Μͩ ̍ɹࣗݾ঺հ ̎ɹݕࡧͱINDEX ̏ɹ࡟আϑϥά ̐ɹϚςϦΞϥΠζυϏϡʔ ̑ɹ·ͱΊ

  173. ·ͱΊ wυΩϡϝϯτΛݟΔ w࣮ߦܭըΛݟΔ wਪଌΑΓ΋ܭଌ

  174. ·ͱΊ ͋Δ೔ಥવ஗͘ͳΔ

  175. ·ͱΊ ͋Δ೔ಥવ஗͘ͳΔ ˣ σʔλྔ͕ϝϞϦʹ৐Βͳ͘ͳΔ

  176. ࣮ફͰϋϚΔ᠘ w ूܭର৅͕େ͖͘ͳͬͯूܭ࣌ʹϝϞϦʹ৐Βͳ͍
 ˠ5FNQPSBSZΛ%JTLʹు͘ͷͰॏ͘ͳΔ w */%&9͕ແ͘5"#-&εΩϟϯΛ͍ͯͨ͠
 ˠςετ࣌͸σʔλ͕খ͔ͬͨ͞ͷͰ໰୊ʹؾ͔ͮͳ͔ͬͨ w ϓϩάϥϜ͕ϧʔϓͷ਺͚ͩΫΤϦΛ౤͍͛ͯͨ
 ˠߦ਺͕૿͑Δͱϧʔϓճ਺͕૿͑ͯॏ͘ͳΔ

    w ߋ৽͕ܹ͘͠*/%&9ͷஅยԽ͕ൃੜͨ͠
 ˠ61%"5&΍%&-&5&ʹΑͬͯ*/%&9͕அยԽͯ͠஗͘ͳΔ
  177. ࣮ફͰϋϚΔ᠘ w ूܭର৅͕େ͖͘ͳͬͯूܭ࣌ʹϝϞϦʹ৐Βͳ͍
 ˠ5FNQPSBSZΛ%JTLʹు͘ͷͰॏ͘ͳΔ w */%&9͕ແ͘5"#-&εΩϟϯΛ͍ͯͨ͠
 ˠςετ࣌͸σʔλ͕খ͔ͬͨ͞ͷͰ໰୊ʹؾ͔ͮͳ͔ͬͨ w ϓϩάϥϜ͕ϧʔϓͷ਺͚ͩΫΤϦΛ౤͍͛ͯͨ
 ˠߦ਺͕૿͑Δͱϧʔϓճ਺͕૿͑ͯॏ͘ͳΔ

    w ߋ৽͕ܹ͘͠*/%&9ͷஅยԽ͕ൃੜͨ͠
 ˠ61%"5&΍%&-&5&ʹΑͬͯ*/%&9͕அยԽͯ͠஗͘ͳΔ ࣮ߦܭըΛ ݟΕΔΑ͏ʹͳΖ͏
  178. ·ͱΊ %#ͷ໰୊͸๨Εͨࠒʹ΍ͬͯ͘Δ

  179. ·ͱΊ

  180. ·ͱΊ 3%#ͷ஌ࣝ͸ण໋͕௕͍

  181. ·ͱΊ 3%#ͷ஌ࣝ͸ण໋͕௕͍ ˣ ֮͑Ε͹࢓ࣄͰ௕͍ؒ໾ʹཱͭ

  182. ·ͱΊ %#ͷ໰୊͸ΫϦςΟΧϧ

  183. ·ͱΊ σʔλͷࢮ͸αʔϏεͷࢮ

  184. ·ͱΊ %#ͷ໰୊͸ΫϦςΟΧϧ ˣ ͭ·Γղܾ͢Ε͹ӳ༤

  185. ·ͱΊ ۪ऀ͸ܦݧʹֶͿ ݡऀ͸աڈʹֶͿ

  186. ·ͱΊ 3%#͸ྺ࢙͕௕͍

  187. ·ͱΊ 3%#͸ྺ࢙͕௕͍ ˣ ৭Μͳܦݧஊ͔Βֶ΂Δ

  188. ·ͱΊ ӡ༻ͱઃܭͱཧ࿦ͷ࿩ ↓ SQLΞϯνύλʔϯͱDB࣮ફೖ໳Λಡ΋͏

  189. ·ͱΊ

  190. ·ͱΊ 3%#͸͍͍ͧɻ

  191. ͝ਗ਼ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠ɻ