{"id":499,"date":"2025-07-16T12:57:46","date_gmt":"2025-07-16T03:57:46","guid":{"rendered":"https:\/\/sejiwon.com\/?p=499"},"modified":"2025-07-16T12:57:46","modified_gmt":"2025-07-16T03:57:46","slug":"row-vs-page-%ec%95%95%ec%b6%95-%eb%b9%84%ea%b5%90-%eb%a6%ac%ed%8f%ac%ed%8a%b8-%ec%83%9d%ec%84%b1-%ec%8a%a4%ed%81%ac%eb%a6%bd%ed%8a%b8","status":"publish","type":"post","link":"https:\/\/sejiwon.com\/?p=499","title":{"rendered":"ROW vs PAGE \uc555\ucd95 \ube44\uad50 \ub9ac\ud3ec\ud2b8 \uc0dd\uc131 \uc2a4\ud06c\ub9bd\ud2b8"},"content":{"rendered":"\n<p>MSSQL\uc5d0\uc11c \ud14c\uc774\ube14 \ub610\ub294 \uc778\ub371\uc2a4\uc5d0 \ub300\ud574 <strong>ROW \uc555\ucd95 vs PAGE \uc555\ucd95 \ud6a8\uacfc\ub97c \ube44\uad50\ud558\ub294 \ub9ac\ud3ec\ud2b8 \uc0dd\uc131 \uc2a4\ud06c\ub9bd\ud2b8<\/strong>\ub294 \uacf5\uc2dd \uc800\uc7a5 \ud504\ub85c\uc2dc\uc800\uc778 <a class=\"\" href=\"https:\/\/learn.microsoft.com\/en-us\/sql\/relational-databases\/system-stored-procedures\/sp-estimate-data-compression-savings-transact-sql\"><code>sp_estimate_data_compression_savings<\/code><\/a> \uc744 \uae30\ubc18\uc73c\ub85c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \ud83d\udcca ROW vs PAGE \uc555\ucd95 \ube44\uad50 \ub9ac\ud3ec\ud2b8 \uc2a4\ud06c\ub9bd\ud2b8<\/h2>\n\n\n\n<p>\uc544\ub798\ub294 <strong>\ud14c\uc774\ube14 \ub0b4 \ubaa8\ub4e0 \uc778\ub371\uc2a4 \ubc0f \ud30c\ud2f0\uc158\uc5d0 \ub300\ud574 \uc555\ucd95 \uc804\ud6c4 \uacf5\uac04 \uc808\uc57d\ub7c9<\/strong>\uc744 \uacc4\uc0b0\ud558\uace0, <strong>ROW \/ PAGE \uc555\ucd95 \ud6a8\uacfc\ub97c \ube44\uad50<\/strong>\ud558\ub294 T-SQL \uc2a4\ud06c\ub9bd\ud2b8\uc785\ub2c8\ub2e4.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\ud83d\udd27 \uc804\uccb4 \ud14c\uc774\ube14 \ub300\uc0c1 (\ud30c\ud2f0\uc158 \uc804\uccb4 \ud3ec\ud568):<\/h3>\n\n\n\n<pre class=\"wp-block-preformatted\"><code>DECLARE @schema_name SYSNAME = 'dbo';\nDECLARE @table_name SYSNAME = 'YourTableName';\n\nIF OBJECT_ID('tempdb..#CompressionResults') IS NOT NULL\n    DROP TABLE #CompressionResults;\n\nCREATE TABLE #CompressionResults (\n    Index_ID INT,\n    Partition_Number INT,\n    Compression_Type VARCHAR(10),\n    Size_Current_KB BIGINT,\n    Size_Estimated_KB BIGINT,\n    Size_Saved_KB AS (Size_Current_KB - Size_Estimated_KB)\n);\n\nDECLARE @index_id INT, @partition_number INT, @sql NVARCHAR(MAX);\n\n-- \uc778\ub371\uc2a4\uc640 \ud30c\ud2f0\uc158 \uc815\ubcf4\ub97c \ub8e8\ud504\nDECLARE cur CURSOR FOR\nSELECT i.index_id, p.partition_number\nFROM sys.indexes i\nJOIN sys.partitions p ON i.object_id = p.object_id AND i.index_id = p.index_id\nWHERE i.object_id = OBJECT_ID(QUOTENAME(@schema_name) + '.' + QUOTENAME(@table_name))\nGROUP BY i.index_id, p.partition_number;\n\nOPEN cur;\nFETCH NEXT FROM cur INTO @index_id, @partition_number;\n\nWHILE @@FETCH_STATUS = 0\nBEGIN\n    -- ROW \uc555\ucd95\n    INSERT INTO #CompressionResults(Index_ID, Partition_Number, Compression_Type, Size_Current_KB, Size_Estimated_KB)\n    EXEC sp_estimate_data_compression_savings\n        @schema_name = @schema_name,\n        @object_name = @table_name,\n        @index_id = @index_id,\n        @partition_number = @partition_number,\n        @data_compression = 'ROW';\n\n    -- PAGE \uc555\ucd95\n    INSERT INTO #CompressionResults(Index_ID, Partition_Number, Compression_Type, Size_Current_KB, Size_Estimated_KB)\n    EXEC sp_estimate_data_compression_savings\n        @schema_name = @schema_name,\n        @object_name = @table_name,\n        @index_id = @index_id,\n        @partition_number = @partition_number,\n        @data_compression = 'PAGE';\n\n    FETCH NEXT FROM cur INTO @index_id, @partition_number;\nEND\n\nCLOSE cur;\nDEALLOCATE cur;\n\n-- \uacb0\uacfc \ub9ac\ud3ec\ud2b8 \ucd9c\ub825\nSELECT \n    Index_ID,\n    Partition_Number,\n    Compression_Type,\n    Size_Current_KB,\n    Size_Estimated_KB,\n    Size_Saved_KB,\n    CAST(100.0 * Size_Saved_KB \/ NULLIF(Size_Current_KB, 0) AS DECIMAL(5,2)) AS Saved_Percent\nFROM #CompressionResults\nORDER BY Partition_Number, Index_ID, Compression_Type;\n<\/code><\/pre>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccb \uacb0\uacfc \uc608\uc2dc (\ucd9c\ub825)<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Index_ID<\/th><th>Partition_Number<\/th><th>Compression_Type<\/th><th>Size_Current_KB<\/th><th>Size_Estimated_KB<\/th><th>Size_Saved_KB<\/th><th>Saved_Percent<\/th><\/tr><\/thead><tbody><tr><td>1<\/td><td>1<\/td><td>ROW<\/td><td>100000<\/td><td>85000<\/td><td>15000<\/td><td>15.00%<\/td><\/tr><tr><td>1<\/td><td>1<\/td><td>PAGE<\/td><td>100000<\/td><td>60000<\/td><td>40000<\/td><td>40.00%<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\u2705 \ucd94\uac00 \ud301<\/h2>\n\n\n\n<ul>\n<li>\uc774 \uc2a4\ud06c\ub9bd\ud2b8\ub294 <strong>\ud074\ub7ec\uc2a4\ud130\ub4dc\/\ube44\ud074\ub7ec\uc2a4\ud130\ub4dc \uc778\ub371\uc2a4 \ubaa8\ub450<\/strong> \ud3ec\ud568<\/li>\n\n\n\n<li><strong>\ud14c\uc774\ube14\uc774 \ud30c\ud2f0\uc158\ub418\uc5b4 \uc788\uc9c0 \uc54a\uc544\ub3c4<\/strong> \uc815\uc0c1 \uc791\ub3d9<\/li>\n\n\n\n<li><code>sp_estimate_data_compression_savings<\/code>\ub294 <strong>\uc77d\uae30 \uc804\uc6a9<\/strong>, \uc2e4\uc81c \ub370\uc774\ud130\ub97c \ubcc0\uacbd\ud558\uc9c0 \uc54a\uc74c<\/li>\n<\/ul>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<h2 class=\"wp-block-heading\">\ud83d\udccc \ud5a5\ud6c4 \uc790\ub3d9\ud654\uc5d0 \ud65c\uc6a9<\/h2>\n\n\n\n<ul>\n<li>\uc704 \uacb0\uacfc\ub97c Excel\ub85c \uc800\uc7a5 \u2192 \uc6a9\ub7c9 \ube44\uad50 \ubcf4\uace0\uc11c \uc791\uc131<\/li>\n\n\n\n<li>\ud2b9\uc815 \uc870\uac74(\uc555\ucd95 \uc808\uac10\ub960 \u2265 30%) \uc774\uc0c1\ub9cc \uc2e4\uc81c \uc555\ucd95 \uc801\uc6a9\ud558\ub294 \uc790\ub3d9\ud654 \uac00\ub2a5<\/li>\n\n\n\n<li>PowerShell \ub610\ub294 SSIS\uc5d0\uc11c \uc774 \uc2a4\ud06c\ub9bd\ud2b8\ub97c \ud638\ucd9c\ud558\uc5ec \ub9ac\ud3ec\ud2b8 \uc790\ub3d9\ud654 \uac00\ub2a5<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>MSSQL\uc5d0\uc11c \ud14c\uc774\ube14 \ub610\ub294 \uc778\ub371\uc2a4\uc5d0 \ub300\ud574 ROW \uc555\ucd95 vs PAGE \uc555\ucd95 \ud6a8\uacfc\ub97c \ube44\uad50\ud558\ub294 \ub9ac\ud3ec\ud2b8 \uc0dd\uc131 \uc2a4\ud06c\ub9bd\ud2b8\ub294 \uacf5\uc2dd \uc800\uc7a5 \ud504\ub85c\uc2dc\uc800\uc778 sp_estimate_data_compression_savings \uc744 \uae30\ubc18\uc73c\ub85c \uc791\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \u2705 \ud83d\udcca ROW vs PAGE \uc555\ucd95 \ube44\uad50 \ub9ac\ud3ec\ud2b8 \uc2a4\ud06c\ub9bd\ud2b8 \uc544\ub798\ub294 \ud14c\uc774\ube14 \ub0b4 \ubaa8\ub4e0 \uc778\ub371\uc2a4 \ubc0f \ud30c\ud2f0\uc158\uc5d0 \ub300\ud574 \uc555\ucd95 \uc804\ud6c4 \uacf5\uac04 \uc808\uc57d\ub7c9\uc744 \uacc4\uc0b0\ud558\uace0, ROW \/ PAGE \uc555\ucd95 \ud6a8\uacfc\ub97c \ube44\uad50\ud558\ub294 T-SQL \uc2a4\ud06c\ub9bd\ud2b8\uc785\ub2c8\ub2e4. \ud83d\udd27\u2026 <span class=\"read-more\"><a href=\"https:\/\/sejiwon.com\/?p=499\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[11],"tags":[],"_links":{"self":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/499"}],"collection":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=499"}],"version-history":[{"count":1,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/sejiwon.com\/index.php?rest_route=\/wp\/v2\/posts\/499\/revisions\/501"}],"wp:attachment":[{"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=499"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=499"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sejiwon.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=499"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}