{"id":2059,"date":"2018-12-29T15:28:47","date_gmt":"2018-12-29T06:28:47","guid":{"rendered":"https:\/\/www.dbsheetclient.jp\/blog\/?p=2059"},"modified":"2018-12-29T15:44:40","modified_gmt":"2018-12-29T06:44:40","slug":"%e8%a8%88%e7%ae%97%e5%88%97%ef%bc%88sql-server%ef%bc%89","status":"publish","type":"post","link":"https:\/\/www.dbsheetclient.jp\/blog\/?p=2059","title":{"rendered":"\u8a08\u7b97\u5217\uff08SQL Server\uff09"},"content":{"rendered":"<p>IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u306e\u30b7\u30e5\u30a6\u3067\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/IMG_1826.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2060\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/IMG_1826-300x225.jpg\" alt=\"IMG_1826\" width=\"300\" height=\"225\" \/><\/a><\/p>\n<p>\u5148\u6708\u3001\u4f1a\u793e\u306e\u540c\u50da\u3068\u6d77\u91e3\u308a\u306b\u884c\u3063\u3066\u304d\u307e\u3057\u305f\u3002<br \/>\u6a2a\u6d5c\u306e\u91d1\u6ca2\u516b\u666f\u306e\u8fd1\u304f\u306e\u6d77\u3067\u3001\u91e3\u308a\u8239\u3092\u4e88\u7d04\u3057\u3066\u697d\u3057\u3093\u3067\u304d\u307e\u3057\u305f\u3002\u305d\u306e\u65e5\u306f\u3068\u3066\u3082\u3088\u3044\u5929\u6c17\u3067\u3001\u30a2\u30b8\u3001\u30b5\u30d0\u3001\u30a4\u30b7\u30e2\u30c1\u306a\u3069\u304c\u7d50\u69cb\u305f\u304f\u3055\u3093\u91e3\u308c\u307e\u3057\u305f\u306d\u3002\u79c1\u306f\u6700\u521d\u306a\u304b\u306a\u304b\u91e3\u308c\u306a\u304f\u3066\u3001\u60aa\u6226\u82e6\u95d8\u3057\u3066\u3044\u305f\u306e\u3067\u3059\u304c\u3001\u96a3\u306b\u3044\u305f\u91e3\u308a\u597d\u304d\u306e\u5148\u8f29\u306b\u304a\u3044\u3066\u306f\u3001\u7aff\u3092\u6295\u3052\u308c\u3070\u3059\u3050\u306b\u5f15\u304d\u304c\u6765\u308b\u611f\u3058\u3067\u3001\u672c\u5f53\u306b\u3073\u3063\u304f\u308a\u3067\u3059\u3002\u540c\u3058\u3088\u3046\u306b\u3084\u3063\u3066\u3044\u308b\u3064\u3082\u308a\u306a\u306e\u306b\u3001\u3069\u3053\u304b\u304c\u9055\u3046\u3093\u3067\u3059\u306d\u3002\u3084\u306f\u308a\u91e3\u308a\u306f\u5965\u304c\u6df1\u3044\uff01\u305d\u308c\u3067\u3082\u3001\u5f8c\u534a\u306f\u591a\u5c11\u91e3\u308c\u305f\u3053\u3068\u3082\u3042\u308a\u3001\u697d\u3057\u3080\u3053\u3068\u304c\u3067\u304d\u307e\u3057\u305f\u3002<br \/>\u4e0a\u306e\u5199\u771f\u306f\u3001\u8239\u304b\u3089\u516b\u666f\u5cf6\u30b7\u30fc\u30d1\u30e9\u30c0\u30a4\u30b9\u306e\u30b8\u30a7\u30c3\u30c8\u30b3\u30fc\u30b9\u30bf\u30fc\u3092\u64ae\u3063\u305f\u3082\u306e\u3067\u3059\u3002<br \/>\u91e3\u308c\u305f\u9b5a\u306f\u3001\u305d\u306e\u65e5\u306e\u3046\u3061\u306b\u3055\u3070\u3044\u3066\u523a\u8eab\u306b\u3057\u3066\u98df\u3079\u307e\u3057\u305f\u3002\u30a2\u30b8\u304c\u3077\u308a\u3077\u308a\u3057\u3066\u3068\u3063\u3066\u3082\u7f8e\u5473\u3057\u304b\u3063\u305f\u3002\u9b5a\u597d\u304d\u306e\u59bb\u3082\u3001\u7f8e\u5473\u3057\u3044\u3068\u559c\u3093\u3067\u304f\u308c\u305f\u306e\u3067\u3001\u3088\u304b\u3063\u305f\u3002<span style=\"color: #333333;\">\uff3c(\uff3e\u25bd\uff3e)\uff0f<\/span><\/p>\n<p>\u3055\u3066\u3001\u4eca\u5e74\u3082\u6b8b\u308a\u308f\u305a\u304b\u3068\u306a\u308a\u307e\u3057\u305f\u3002\u98a8\u90aa\u306a\u3069\u5f15\u304b\u306a\u3044\u3067\u3001\u3088\u3044\u5e74\u3092\u8fce\u3048\u3089\u308c\u307e\u3059\u3053\u3068\u3092\u304a\u7948\u308a\u3044\u305f\u3057\u307e\u3059\u3002\u6765\u5e74\u3082\u3001\u3088\u308d\u3057\u304f\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002<br \/><strong><br \/>\uff1c\u672c\u65e5\u306e\u984c\u6750\uff1e<br \/><\/strong><strong>\u8a08\u7b97\u5217\uff08SQL Server<\/strong><strong>\uff09<\/p>\n<p><\/strong>SQL Server\u3067\u3001\u8a08\u7b97\u5217\u3068\u3044\u3046\u3082\u306e\u304c\u3042\u308b\u3068\u3044\u3046\u3053\u3068\u306a\u306e\u3067\u3001\u8a66\u3057\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>\u4f8b\uff09<br \/>\u4ee5\u524d\u3001\u8eab\u9577\u3068\u4f53\u91cd\u304b\u3089BMI\uff08\u80a5\u6e80\u6307\u6570\uff09\u3092\u30b9\u30c8\u30a2\u30c9\u30fb\u30d5\u30a1\u30f3\u30af\u30b7\u30e7\u30f3\u3092\u4f7f\u3063\u3066\u6c42\u3081\u305f\u3053\u3068\u304c\u3042\u308a\u307e\u3057\u305f\u304c\u3001\u4eca\u56de\u306f\u8a08\u7b97\u5217\u3067\u3053\u308c\u3092\u884c\u3063\u3066\u307f\u305f\u3044\u3068\u601d\u3044\u307e\u3059\u3002<\/p>\n<p>CREATE TABLE dbo.syain_health(<br \/>id\u00a0\u00a0\u00a0\u00a0\u00a0 INT<br \/>,height\u00a0 DECIMAL(5,1)<br \/>,weight\u00a0 DECIMAL(5,1)<br \/>,bmi\u00a0\u00a0\u00a0\u00a0 AS (<br \/>\u00a0 \u00a0 \u00a0 weight \/(height\/100 * height\/100))<br \/>,CONSTRAINT PK_syain_health PRIMARY KEY (id));<\/p>\n<p>\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u5f8c\u306b\u3001\u30c6\u30fc\u30d6\u30eb\u306e\u5b9a\u7fa9\u3092\u3001SQL Server Management Studio \u3067\u78ba\u8a8d\u3059\u308b\u3068\u3001<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/\u5b9a\u7fa9.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2061\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/\u5b9a\u7fa9-300x190.png\" alt=\"\u5b9a\u7fa9\" width=\"300\" height=\"190\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/\u5b9a\u7fa9-300x190.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/\u5b9a\u7fa9.png 309w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u6700\u5f8c\u306e\u300cbmi\u300d\u9805\u76ee\u304c\u8a08\u7b97\u5217\u306b\u306a\u308a\u307e\u3059\u3002<br \/>\u305d\u308c\u3067\u306f\u3001\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3057\u3066\u307f\u307e\u3059\u3002\u3053\u306e\u3068\u304d\u3001\u8a08\u7b97\u5217\u306b\u306fInsert\u3057\u307e\u305b\u3093\u3002<\/p>\n<p>INSERT INTO dbo.syain_health(id, height, weight) VALUES(1, 165.1, 61.2);<br \/>INSERT INTO dbo.syain_health(id, height, weight) VALUES(2, 174.4, 65.6);<br \/>INSERT INTO dbo.syain_health(id, height, weight) VALUES(3, 182.3, 71.3);<br \/>INSERT INTO dbo.syain_health(id, height, weight) VALUES(4, 168.8, 63.1);<br \/>INSERT INTO dbo.syain_health(id, height, weight) VALUES(5, 172.0, 84.9);<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/Insert.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2062\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/Insert-300x148.png\" alt=\"Insert\" width=\"300\" height=\"148\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/Insert-300x148.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/Insert.png 563w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u8a08\u7b97\u5217\u306b\u30c7\u30fc\u30bf\u3092\u767b\u9332\u3057\u3088\u3046\u3068\u3059\u308b\u3068\u3001\u4e0b\u8a18\u306e\u3088\u3046\u306b\u30a8\u30e9\u30fc\u304c\u51fa\u307e\u3059\u3002<\/p>\n<p>INSERT INTO dbo.syain_health(id, height, weight, bmi) VALUES(6, 176.0, 73.5, 25.3);<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_err.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-2063\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_err-300x57.png\" alt=\"insert_err\" width=\"339\" height=\"65\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_err-300x57.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_err.png 657w\" sizes=\"auto, (max-width: 339px) 100vw, 339px\" \/><\/a><\/p>\n<p>\u00a0\u305d\u308c\u3067\u306f\u3001\u30c7\u30fc\u30bf\u3092SELECT\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>SELECT * FROM dbo.syain_health<br \/>ORDER BY id;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/syain_select.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2065\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/syain_select-300x184.png\" alt=\"syain_select\" width=\"300\" height=\"184\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/syain_select-300x184.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/syain_select.png 362w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u8a08\u7b97\u5217\u3067\u6307\u5b9a\u3057\u305f\u300cbmi\u300d\u5217\u306f\u3001\u81ea\u52d5\u7684\u306b\u8a08\u7b97\u3055\u308c\u3066\u62bd\u51fa\u3055\u308c\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3059\u3002<\/p>\n<p>\u307e\u305f\u3001\u8a08\u7b97\u5217\u306b\u306f\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u307e\u3059\u3002<br \/>\u30c7\u30fc\u30bf\u3092100\u4e07\u4ef6\u307b\u3069\u4f5c\u6210\u3057\u3066\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u306e\u6709\u7121\u306b\u3088\u308b\u30ec\u30b9\u30dd\u30f3\u30b9\u3092\u6bd4\u8f03\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>\u8eab\u9577\u306f\u3001140\u30bb\u30f3\u30c1\u4ee5\u4e0a200\u30bb\u30f3\u30c1\u4ee5\u5185\u3001\u4f53\u91cd\u306f40\u30ad\u30ed\u4ee5\u4e0a100\u30ad\u30ed\u4ee5\u5185\u3067\u30e9\u30f3\u30c0\u30e0\u306b\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002\u3053\u306e\u3068\u304d\u3001RAND\u95a2\u6570\u3092\u5229\u7528\u3057\u3066\u307f\u307e\u3059\u3002RAND\u95a2\u6570\u306f\u30010\uff5e1\u307e\u3067\u306e\u7bc4\u56f2\u306e\u4e71\u6570\u3092float\u578b\u3067\u53d6\u5f97\u3059\u308b\u3082\u306e\u3067\u3059\u3002<\/p>\n<p>DECLARE<br \/>\u00a0 @v_count INT = 5;\u00a0\u00a0\u00a0\u00a0 &#8212; id \u306f\u65e2\u306b1\uff5e5\u306f\u4f5c\u6210\u6e08\u306a\u306e\u3067\u521d\u671f\u5024\u30925<\/p>\n<p>WHILE @v_count &lt; 1000000<br \/>BEGIN<br \/>\u00a0 \u00a0 SET @v_count = @v_count + 1;<br \/>\u00a0<br \/> \u00a0 \u00a0INSERT INTO dbo.syain_health(id, height, weight)VALUES<br \/>\u00a0 \u00a0 (@v_count, ROUND(140+RAND() * 600\/10,1), ROUND(40+RAND() * 600\/10,1));<br \/>END;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_300\u4e07.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2066\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_300\u4e07-300x196.png\" alt=\"insert_300\u4e07\" width=\"300\" height=\"196\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_300\u4e07-300x196.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/insert_300\u4e07.png 601w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u518d\u5ea6\u30c7\u30fc\u30bf\u3092\u78ba\u8a8d\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>SELECT * FROM dbo.syain_health<br \/>ORDER BY id;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_300.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2067\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_300-246x300.png\" alt=\"select_300\" width=\"246\" height=\"300\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_300-246x300.png 246w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_300.png 315w\" sizes=\"auto, (max-width: 246px) 100vw, 246px\" \/><\/a><\/p>\n<p>\u00a0\u4ef6\u6570\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001<\/p>\n<p>SELECT COUNT(*) FROM dbo.syain_health;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_count.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2069\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_count-300x117.png\" alt=\"select_count\" width=\"300\" height=\"117\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_count-300x117.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/select_count.png 332w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u305d\u308c\u3067\u306f\u3001bmi \u306e\u5024\u304c 20 \uff5e 25 \u306e\u4eba\u306e\u4ef6\u6570\u3092\u78ba\u8a8d\u3057\u307e\u3059\u3002<br \/>\u6642\u9593\u3092\u8a08\u6e2c\u3059\u308b\u305f\u3081\u3001\u4ee5\u4e0b\u306e\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u307e\u3059\u3002<\/p>\n<p>SET STATISTICS TIME ON<\/p>\n<p>SELECT COUNT(*) FROM dbo.syain_health<br \/>WHERE bmi BETWEEN 20 AND 25;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2070\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30-300x132.png\" alt=\"count_25_30\" width=\"300\" height=\"132\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30-300x132.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30.png 325w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u30e1\u30c3\u30bb\u30fc\u30b8\u30bf\u30d6\u3067\u8868\u793a\u3055\u308c\u3066\u3044\u308b\u6642\u9593\u306f\u3001<br \/>SQL Server \u5b9f\u884c\u6642\u9593:<br \/>\u3001CPU \u6642\u9593 = 671 \u30df\u30ea\u79d2\u3001\u7d4c\u904e\u6642\u9593 = 673 \u30df\u30ea\u79d2\u3002<\/p>\n<p>\u6b21\u306b\u3001\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3057\u3066\u307f\u307e\u3059\u3002<\/p>\n<p>CREATE INDEX IX_syain_bmi ON dbo.syain(bmi);<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/cre_index.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2071\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/cre_index-300x85.png\" alt=\"cre_index\" width=\"300\" height=\"85\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/cre_index-300x85.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/cre_index.png 391w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u4e00\u5ea6\u3001\u30c7\u30fc\u30bf\u30d0\u30c3\u30d5\u30a1\u30ad\u30e3\u30c3\u30b7\u30e5\u3092\u30af\u30ea\u30a2\u3057\u307e\u3059\u3002<br \/>DBCC DROPCLEANBUFFERS<\/p>\n<p>\u518d\u5ea6\u3001\u5148\u307b\u3069\u306e\u51e6\u7406\u3092\u5b9f\u884c\u3057\u3066\u307f\u307e\u3059\u3002<br \/>SELECT COUNT(*) FROM dbo.syain_health<br \/>WHERE bmi BETWEEN 20 AND 25;<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2070\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30-300x132.png\" alt=\"count_25_30\" width=\"300\" height=\"132\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30-300x132.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30.png 325w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>\u3053\u306e\u3068\u304d\u306e\u6642\u9593\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001<br \/>SQL Server \u5b9f\u884c\u6642\u9593:<br \/>\u3001CPU \u6642\u9593 = 16 \u30df\u30ea\u79d2\u3001\u7d4c\u904e\u6642\u9593 = 26 \u30df\u30ea\u79d2\u3002<\/p>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u3067\u3001\u51e6\u7406\u306f\u901f\u304f\u306a\u3063\u3066\u3044\u308b\u3053\u3068\u304c\u78ba\u8a8d\u3067\u304d\u307e\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u8a08\u7b97\u5217\u306f\u7269\u7406\u7684\u306b\u30c7\u30fc\u30bf\u3092\u4fdd\u5b58\u3059\u308b\u3053\u3068\u3082\u3067\u304d\u308b\u3068\u3044\u3046\u3053\u3068\u3067\u3001\u305d\u306e\u5834\u5408\u306b\u306f\u3001\u30c6\u30fc\u30d6\u30eb\u4f5c\u6210\u6642\u306b\u3001\u8a08\u7b97\u5217\u306e\u5f8c\u308d\u306bPRESISTED\u00a0\u3092\u4ed8\u3051\u307e\u3059\u3002<\/p>\n<p>CREATE TABLE dbo.syain_health2(<br \/> id\u00a0\u00a0\u00a0\u00a0\u00a0 INT<br \/>,height\u00a0 DECIMAL(5,1)<br \/>,weight\u00a0 DECIMAL(5,1)<br \/>,bmi\u00a0\u00a0\u00a0\u00a0 AS (<br \/>\u00a0 \u00a0 \u00a0 weight \/(height\/100 * height\/100)) PERSISTED<br \/>,CONSTRAINT PK_syain_health2 PRIMARY KEY (id));<\/p>\n<p>\u30a4\u30f3\u30c7\u30c3\u30af\u30b9\u3082\u8ffd\u52a0\u3057\u307e\u3059\u3002<br \/>CREATE INDEX IX_syain_health_bmi2 ON dbo.syain_health2(bmi);<\/p>\n<p>\u305d\u306e\u5f8c\u3001\u540c\u69d8\u306b\u30c7\u30fc\u30bf\u3092100\u4e07\u4ef6\u4f5c\u6210\u3057\u3066\u3001\u5148\u307b\u3069\u3068\u540c\u69d8\u306e\u3053\u3068\u3092\u884c\u3063\u3066\u307f\u307e\u3059\u3002<\/p>\n<p><a href=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30_2.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-2072\" src=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30_2-300x119.png\" alt=\"count_25_30_2\" width=\"300\" height=\"119\" srcset=\"https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30_2-300x119.png 300w, https:\/\/www.dbsheetclient.jp\/blog\/wp-content\/uploads\/2018\/12\/count_25_30_2.png 366w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>SQL Server \u5b9f\u884c\u6642\u9593:<br \/>\u3001CPU \u6642\u9593 = 16 \u30df\u30ea\u79d2\u3001\u7d4c\u904e\u6642\u9593 = 17 \u30df\u30ea\u79d2\u3002<\/p>\n<p>\u7269\u7406\u7684\u306b\u30c7\u30fc\u30bf\u304c\u4fdd\u5b58\u3055\u308c\u3066\u3044\u308b\u5834\u5408\u3068\u305d\u3046\u3067\u306a\u3044\u5834\u5408\u3067\u306e\u51e6\u7406\u6642\u9593\u306e\u9055\u3044\u306b\u3064\u3044\u3066\u306f\u3001\u305d\u308c\u307b\u3069\u9055\u3044\u306f\u7121\u3044\u3088\u3046\u3067\u3059\u304c\u3001\u591a\u5c11\u901f\u3044\u611f\u3058\u3067\u3057\u3087\u3046\u304b\u3002<\/p>\n<p>\u4eca\u65e5\u306f\u4ee5\u4e0a\u307e\u3067<\/p>\n","protected":false},"excerpt":{"rendered":"<p>IT\u30b3\u30fc\u30c7\u30a3\u30cd\u30fc\u30bf\u306e\u30b7\u30e5\u30a6\u3067\u3059\u3002 \u5148\u6708\u3001\u4f1a\u793e\u306e\u540c\u50da\u3068\u6d77\u91e3\u308a\u306b\u884c\u3063\u3066\u304d\u307e\u3057\u305f\u3002\u6a2a\u6d5c\u306e\u91d1\u6ca2\u516b\u666f\u306e\u8fd1\u304f\u306e\u6d77\u3067\u3001\u91e3\u308a\u8239\u3092\u4e88\u7d04\u3057\u3066\u697d\u3057\u3093\u3067\u304d\u307e\u3057\u305f\u3002\u305d\u306e\u65e5\u306f\u3068\u3066\u3082\u3088\u3044\u5929\u6c17\u3067\u3001\u30a2\u30b8\u3001\u30b5\u30d0\u3001\u30a4\u30b7\u30e2\u30c1\u306a\u3069\u304c\u7d50\u69cb\u305f\u304f\u3055\u3093\u91e3\u308c\u307e\u3057\u305f\u306d\u3002\u79c1\u306f [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"enabled":false},"version":2}},"categories":[25,30],"tags":[],"class_list":["post-2059","post","type-post","status-publish","format-standard","hentry","category-25","category-30"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2059","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=2059"}],"version-history":[{"count":5,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions"}],"predecessor-version":[{"id":2075,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=\/wp\/v2\/posts\/2059\/revisions\/2075"}],"wp:attachment":[{"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=2059"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=2059"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbsheetclient.jp\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=2059"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}