{"id":2237,"date":"2022-09-19T07:00:00","date_gmt":"2022-09-19T04:00:00","guid":{"rendered":"https:\/\/www.dataplatform.gr\/?p=2237"},"modified":"2024-10-16T14:42:35","modified_gmt":"2024-10-16T11:42:35","slug":"pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server","status":"publish","type":"post","link":"https:\/\/www.dataplatform.gr\/en\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/","title":{"rendered":"How we find the performance of existing Indexes and which new Indexes SQL Server recommends"},"content":{"rendered":"<p>In a previous article we saw <a href=\"https:\/\/www.dataplatform.gr\/en\/pos-apothikeyontai-oi-vaseis-dedomenon-kai-ti-einai-ta-indexes\/\" target=\"_blank\" rel=\"noreferrer noopener\">what are indexes<\/a>. In this article we will see how to find the status of their hash, if you are using them, when they were created, when they were updated and if there are missing indexes that SQL Server recommends.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What should we remember?<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>When a table has <strong>clustered index <\/strong>means that the data is stored in the order that is the field\/fields that we have defined the clustered index. Each table can have <strong>just one<\/strong> clustered index.<\/li>\n\n\n\n<li>When a table <strong>does not have a clustered index<\/strong> it is called <strong>heap <\/strong>and its data is stored out of order on disk. So in the results of the script we will see that each table in the index type will definitely have either a clustered index or a heap and never both.<\/li>\n\n\n\n<li>The <strong>non-clustered indexes <\/strong>they have his role <strong>index<\/strong>, are a copy of the data in the fields it has been made plus the fields they have <strong>included <\/strong>to a different object.<\/li>\n\n\n\n<li>The index fields must not overlap, e.g. if we have a non-clustered index <em>at [phone numbers] <\/em>and one in [<em>area] , [at phone no<\/em>] the first index is not needed so it should be deleted. (for their maintenance and memory reasons)<\/li>\n\n\n\n<li>The size of the table (whether clustered or heap) and of each non-clustered index can also be measured in <strong>pages<\/strong>. Each page is 8KB, so if we multiply it by the number of them we find the size of the table \/ non-clustered index.<\/li>\n\n\n\n<li>As the records of a table change, they are fragmented, that is, their order is lost, this is called <strong>fragmentation<\/strong>. To reduce it, we should do the index rebuild or reorganize if the fragmentation rate is small.<\/li>\n\n\n\n<li>As it consists of fewer pages, it makes sense that it will more easily have greater fragmentation <strong>but performance is not affected as much<\/strong>. e.g. If a second page is added to a table with one page, we will directly have 50% fragmentation.<\/li>\n\n\n\n<li>Some dynamic views that provide us with the information we need, <strong>they empty<\/strong> every time the SQL Server service is restarted.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">How do we find the fragmentation of indexes<\/h2>\n\n\n\n<p>With the following script that I have made, we quickly find the fragmentation of each index with a series of pages. We can remove it from comment <em>\u2013and dbtables.[name] in (&#039;car_calc&#039;)<\/em> to find only for a specific table:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">select distinct \ndbschemas.[name] as 'Schema',\ndbtables.[name] as 'Table',\ndbindexes.[name] as 'Index',\nclustertype.index_type_desc as 'IndexType',\nclustertype.avg_fragmentation_in_percent,\nclustertype.page_count,\nclustertype.index_type_desc\nFROM sys.indexes AS dbindexes \nINNER JOIN sys.dm_db_index_physical_stats  (DB_ID(), NULL, NULL, NULL, NULL) as clustertype ON clustertype.[object_id] = dbindexes.[object_id] AND clustertype.index_id = dbindexes.index_id\nINNER JOIN sys.tables dbtables on dbtables.[object_id] = clustertype.[object_id]\nINNER JOIN sys.schemas dbschemas on dbtables.[schema_id] = dbschemas.[schema_id]\nWHERE 1=1\n--and dbindexes.[name] is not NULL\n--and clustertype.index_type_desc = 'NONCLUSTERED INDEX'\n--and dbtables.[name] in ('car_calc')\nORDER BY page_count desc,dbtables.name desc<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"848\" height=\"275\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-02.png\" alt=\"\" class=\"wp-image-2238\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-02.png 848w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-02-300x97.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-02-768x249.png 768w\" sizes=\"auto, (max-width: 848px) 100vw, 848px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Indexes recommended by SQL Server<\/h2>\n\n\n\n<p>When SQL Server sees that some queries need an index in some field that is used, it suggests creating them. Because it is not always fair, it is necessary to evaluate them. With the following script, those who recommend us are shown:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">SELECT db.[name] AS [DatabaseName]\n    ,id.[object_id] AS [ObjectID]\n\t,OBJECT_NAME(id.[object_id], db.[database_id]) AS [ObjectName]\n    ,id.[statement] AS [FullyQualifiedObjectName]\n    ,id.[equality_columns] AS [EqualityColumns]\n    ,id.[inequality_columns] AS [InEqualityColumns]\n    ,id.[included_columns] AS [IncludedColumns]\n    ,gs.[unique_compiles] AS [UniqueCompiles]\n    ,gs.[user_seeks] AS [UserSeeks]\n    ,gs.[user_scans] AS [UserScans]\n    ,gs.[last_user_seek] AS [LastUserSeekTime]\n    ,gs.[last_user_scan] AS [LastUserScanTime]\n    ,gs.[avg_total_user_cost] AS [AvgTotalUserCost]  -- Average cost of the user queries that could be reduced by the index in the group.\n    ,gs.[avg_user_impact] AS [AvgUserImpact]  -- The value means that the query cost would on average drop by this percentage if this missing index group was implemented.\n    ,gs.[system_seeks] AS [SystemSeeks]\n    ,gs.[system_scans] AS [SystemScans]\n    ,gs.[last_system_seek] AS [LastSystemSeekTime]\n    ,gs.[last_system_scan] AS [LastSystemScanTime]\n    ,gs.[avg_total_system_cost] AS [AvgTotalSystemCost]\n    ,gs.[avg_system_impact] AS [AvgSystemImpact]  -- Average percentage benefit that system queries could experience if this missing index group was implemented.\n    ,gs.[user_seeks] * gs.[avg_total_user_cost] * (gs.[avg_user_impact] * 0.01) AS [IndexAdvantage]\n    ,'CREATE INDEX [IX_' + OBJECT_NAME(id.[object_id], db.[database_id]) + '_' + REPLACE(REPLACE(REPLACE(ISNULL(id.[equality_columns], ''), ', ', '_'), '[', ''), ']', '') + CASE\n        WHEN id.[equality_columns] IS NOT NULL\n            AND id.[inequality_columns] IS NOT NULL\n            THEN '_'\n        ELSE ''\n        END + REPLACE(REPLACE(REPLACE(ISNULL(id.[inequality_columns], ''), ', ', '_'), '[', ''), ']', '') + '_' + LEFT(CAST(NEWID() AS [nvarchar](64)), 5) + ']' + ' ON ' + id.[statement] + ' (' + ISNULL(id.[equality_columns], '') + CASE\n        WHEN id.[equality_columns] IS NOT NULL\n            AND id.[inequality_columns] IS NOT NULL\n            THEN ','\n        ELSE ''\n        END + ISNULL(id.[inequality_columns], '') + ')' + ISNULL(' INCLUDE (' + id.[included_columns] + ')', '') AS [ProposedIndex]\n    ,CAST(CURRENT_TIMESTAMP AS [smalldatetime]) AS [CollectionDate]\nFROM [sys].[dm_db_missing_index_group_stats] gs WITH (NOLOCK)\nINNER JOIN [sys].[dm_db_missing_index_groups] ig WITH (NOLOCK) ON gs.[group_handle] = ig.[index_group_handle]\nINNER JOIN [sys].[dm_db_missing_index_details] id WITH (NOLOCK) ON ig.[index_handle] = id.[index_handle]\nINNER JOIN [sys].[databases] db WITH (NOLOCK) ON db.[database_id] = id.[database_id]\nWHERE  db.[database_id] = DB_ID()\n--AND OBJECT_NAME(id.[object_id], db.[database_id]) = 'YourTableName'\nORDER BY ObjectName, [IndexAdvantage] DESC\nOPTION (RECOMPILE);<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"162\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-01-1024x162.png\" alt=\"\" class=\"wp-image-2243\" style=\"width:606px;height:95px\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-01-1024x162.png 1024w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-01-300x47.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-01-768x121.png 768w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-01.png 1038w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How do we find when each Index was created?<\/h2>\n\n\n\n<p>We cannot directly see when each index was created as SQL Server does not keep the information. With the following script we find when each index was created <strong>clustered index <\/strong>in the field <strong>created_date <\/strong>and when was the table modified along with the indexes which may mean creation <strong>nonclustered index <\/strong>in the field <strong>modify_date<\/strong>:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">select \n    i.name as IndexName, \n    o.name as TableName, \n\tco.[name] as ColumnName,\n    ic.key_ordinal as ColumnOrder,\n    ic.is_included_column as IsIncluded, \n    o.create_date,\n    o.modify_date\nfrom sys.indexes i \ninner join sys.objects o on i.object_id = o.object_id and o.type_desc = 'USER_TABLE'\ninner join sys.index_columns ic on ic.object_id = i.object_id and ic.index_id = i.index_id\ninner join sys.columns co on co.object_id = i.object_id \n    and co.column_id = ic.column_id\nwhere 1=1\nand i.[type] in (1,2)\norder by o.[name], i.[name], ic.is_included_column, ic.key_ordinal;<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"203\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-03.png\" alt=\"\" class=\"wp-image-2239\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-03.png 686w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-03-300x89.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How do we find when each Index was last Rebuilt?<\/h2>\n\n\n\n<p>SQL Server does not store the information of when the index was last rebuilt, but it stores the last time the statistics were updated. In the default behavior, every time an index rebuild is performed, the statistics update is also performed, so knowing the date of the second, we also know the date of the first.<\/p>\n\n\n\n<p>With the following script we find the date of the last statistics:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">select OBJECT_NAME(object_id) [TableName], \n       name [IndexName],\n       stats_date(object_id, stats_id) [LastStatsUpdate]\nfrom sys.stats\nwhere name not like '_WA%'\n--and stats_date(object_id, stats_id) IS NOT NULL\nand OBJECTPROPERTY(object_id, 'IsMSShipped') = 0\n--and OBJECT_NAME(object_id) = 'pinakas'\nORDER BY LastStatsUpdate DESC\n<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"452\" height=\"166\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-04.png\" alt=\"\" class=\"wp-image-2240\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-04.png 452w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-04-300x110.png 300w\" sizes=\"auto, (max-width: 452px) 100vw, 452px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">How do we find out how much each Index is used (Unused Indexes)<\/h2>\n\n\n\n<p>Sometimes we create indexes that are not used, this results in them taking up space in the SQL Server&#039;s memory (RAM) without benefit, also the increased number of indexes delays inserts\/deletes\/updates since updates must be made to them as well as their maintenance.<\/p>\n\n\n\n<p>With the following script we can see for each index how many times it was accessed, in what way and when was the last time:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">SELECT \nDB_NAME([database_id]) as DatabaseName,\ns.name As TSchema,\no.name AS TableName\n, i.name AS IndexName\n, dm_ius.user_seeks AS UserSeeks\n, dm_ius.user_scans AS UserScans\n, dm_ius.user_lookups AS UserLookups\n, dm_ius.user_updates AS UserUpdates\n,o.create_date\n,m.modify_date\n,'drop index ['+s.name +'].[' +o.name+ '].[' + i.name +'];' as DropCommand\nFROM sys.dm_db_index_usage_stats dm_ius WITH (NOLOCK)\nINNER JOIN sys.indexes i ON i.index_id = dm_ius.index_id \nAND dm_ius.OBJECT_ID = i.OBJECT_ID\nINNER JOIN sys.objects o ON dm_ius.OBJECT_ID = o.OBJECT_ID\nINNER JOIN sys.schemas s ON o.schema_id = s.schema_id\nWHERE OBJECTPROPERTY(dm_ius.OBJECT_ID,'IsUserTable') = 1\nAND dm_ius.database_id = DB_ID()\nAND dm_ius.database_id > 4\nAND i.type_desc = 'nonclustered'\nAND i.is_primary_key = 0\nAND i.is_unique_constraint = 0\n\/*\n\tAND\n    dm_ius.user_lookups = 0\n    AND\n    dm_ius.user_seeks = 0\n    AND\n    dm_ius.user_scans = 0\n*\/\nORDER BY dm_ius.user_updates desc<\/pre>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"159\" src=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-05-1024x159.png\" alt=\"\" class=\"wp-image-2241\" srcset=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-05-1024x159.png 1024w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-05-300x47.png 300w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-05-768x119.png 768w, https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/10\/idx-05.png 1062w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">How do we find Duplicate Indexes?<\/h2>\n\n\n\n<p>While creating new indexes, there is a chance that we will create duplicate indexes or indexes that overlap the same columns in the same order. This results in delays in inserts, updates, and deletes as well as index maintenance. So we need to find these indexes and delete them.<\/p>\n\n\n\n<p>With the following query we will find all the information we need:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"sql\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\" data-no-translation=\"\" data-no-auto-translation=\"\">CREATE TABLE #duplindex\n( \n  [database_name]  NVARCHAR(255),\n  [schema_name] NVARCHAR(255),\n  [table_name] NVARCHAR(255),\n  [index_name] NVARCHAR(255),\n  [key_column_list] NVARCHAR(max),\n  [include_column_list] NVARCHAR(max),\n  [is_disabled] NVARCHAR(10)\n  )\n \nDECLARE @DatabaseID as INT;\nDECLARE @DatabaseName as NVARCHAR(250);\nDECLARE @DatabaseCursor as CURSOR;\nDECLARE @dxml NVARCHAR(MAX);\nDECLARE @dbody NVARCHAR(MAX);\nSET @DatabaseCursor = CURSOR FOR\nSELECT name, database_id\n  FROM sys.databases WITH (NOLOCK) where name not in ( 'master', 'model', 'msdb', 'tempdb')\n  and state_desc='ONLINE'\n  and is_read_only = 0;\nOPEN @DatabaseCursor;\nFETCH NEXT FROM @DatabaseCursor INTO @DatabaseName, @DatabaseID;\nWHILE @@FETCH_STATUS = 0\nBEGIN\n \nEXECUTE ('USE [' + @DatabaseName + ']'+'\n \n;WITH CTE_INDEX_DATA AS (\n       SELECT TABLE_DATA.object_id,\n\t\t\t  INDEX_DATA.index_id,\n              SCHEMA_DATA.name AS schema_name,\n              TABLE_DATA.name AS table_name,\n              INDEX_DATA.name AS index_name,\n              STUFF((SELECT  '', '' + COLUMN_DATA_KEY_COLS.name + '' '' + CASE WHEN INDEX_COLUMN_DATA_KEY_COLS.is_descending_key = 1 THEN ''DESC'' ELSE ''ASC'' END -- Include column order (ASC \/ DESC)\n                                  FROM    sys.tables AS T WITH (NOLOCK)\n                                                INNER JOIN sys.indexes INDEX_DATA_KEY_COLS\n                                                ON T.object_id = INDEX_DATA_KEY_COLS.object_id\n                                                INNER JOIN sys.index_columns INDEX_COLUMN_DATA_KEY_COLS\n                                                ON INDEX_DATA_KEY_COLS.object_id = INDEX_COLUMN_DATA_KEY_COLS.object_id\n                                                AND INDEX_DATA_KEY_COLS.index_id = INDEX_COLUMN_DATA_KEY_COLS.index_id\n                                                INNER JOIN sys.columns COLUMN_DATA_KEY_COLS\n                                                ON T.object_id = COLUMN_DATA_KEY_COLS.object_id\n                                                AND INDEX_COLUMN_DATA_KEY_COLS.column_id = COLUMN_DATA_KEY_COLS.column_id\n                                  WHERE   INDEX_DATA.object_id = INDEX_DATA_KEY_COLS.object_id\n                                                AND INDEX_DATA.index_id = INDEX_DATA_KEY_COLS.index_id\n                                                AND INDEX_COLUMN_DATA_KEY_COLS.is_included_column = 0\n                                  ORDER BY INDEX_COLUMN_DATA_KEY_COLS.key_ordinal\n                                  FOR XML PATH('''')), 1, 2, '''') AS key_column_list ,\n          STUFF(( SELECT  '', '' + COLUMN_DATA_INC_COLS.name\n                                  FROM    sys.tables AS T WITH (NOLOCK)\n                                                INNER JOIN sys.indexes INDEX_DATA_INC_COLS WITH (NOLOCK)\n                                                ON T.object_id = INDEX_DATA_INC_COLS.object_id\n                                                INNER JOIN sys.index_columns INDEX_COLUMN_DATA_INC_COLS WITH (NOLOCK)\n                                                ON INDEX_DATA_INC_COLS.object_id = INDEX_COLUMN_DATA_INC_COLS.object_id\n                                                AND INDEX_DATA_INC_COLS.index_id = INDEX_COLUMN_DATA_INC_COLS.index_id\n                                                INNER JOIN sys.columns COLUMN_DATA_INC_COLS WITH (NOLOCK)\n                                                ON T.object_id = COLUMN_DATA_INC_COLS.object_id\n                                                AND INDEX_COLUMN_DATA_INC_COLS.column_id = COLUMN_DATA_INC_COLS.column_id\n                                  WHERE   INDEX_DATA.object_id = INDEX_DATA_INC_COLS.object_id\n                                                AND INDEX_DATA.index_id = INDEX_DATA_INC_COLS.index_id\n                                                AND INDEX_COLUMN_DATA_INC_COLS.is_included_column = 1\n                                  ORDER BY INDEX_COLUMN_DATA_INC_COLS.key_ordinal\n                                  FOR XML PATH('''')), 1, 2, '''') AS include_column_list,\n       INDEX_DATA.is_disabled -- Check if index is disabled before determining which dupe to drop (if applicable)\n       FROM sys.indexes INDEX_DATA WITH (NOLOCK)\n       INNER JOIN sys.tables TABLE_DATA WITH (NOLOCK)\n       ON TABLE_DATA.object_id = INDEX_DATA.object_id\n       INNER JOIN sys.schemas SCHEMA_DATA WITH (NOLOCK)\n       ON SCHEMA_DATA.schema_id = TABLE_DATA.schema_id\n       WHERE TABLE_DATA.is_ms_shipped = 0\n       AND INDEX_DATA.type_desc IN (''NONCLUSTERED'', ''CLUSTERED'')\n)\nInsert into #duplindex\nSELECT db_name(), DUPE1.schema_name, DUPE1.table_name,DUPE1.index_name,DUPE1.key_column_list,DUPE1.include_column_list,DUPE1.is_disabled\nFROM CTE_INDEX_DATA DUPE1    \n \nWHERE EXISTS\n(SELECT * FROM CTE_INDEX_DATA DUPE2\nWHERE DUPE1.schema_name = DUPE2.schema_name\nAND DUPE1.table_name = DUPE2.table_name\nAND (DUPE1.key_column_list LIKE LEFT(DUPE2.key_column_list, LEN(DUPE1.key_column_list)) OR DUPE2.key_column_list LIKE LEFT(DUPE1.key_column_list, LEN(DUPE2.key_column_list)))\nAND DUPE1.index_name &lt;> DUPE2.index_name) OPTION (MAXDOP 4)\n')\nFETCH NEXT FROM @DatabaseCursor INTO @DatabaseName, @DatabaseID;\n \nEND\nCLOSE @DatabaseCursor;\nDEALLOCATE @DatabaseCursor;\n \nselect \ndatabase_name as 'Database Name',\nschema_name as 'Schema',\ntable_name as 'Table',\nindex_name as 'Index Name',\nkey_column_list as 'Key Column List',\ninclude_column_list as 'Include Column List',\nis_disabled as 'Is Disabled'\nfrom #duplindex\nDROP TABLE #duplindex\n <\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Sources:<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/system-catalog-views\/sys-indexes-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">sys.indexes (Transact-SQL)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/system-dynamic-management-views\/sys-dm-db-index-physical-stats-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">sys.dm_db_index_physical_stats (Transact-SQL)<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/sql\/relational-databases\/system-dynamic-management-views\/sys-dm-db-missing-index-details-transact-sql?view=sql-server-ver15\" target=\"_blank\" rel=\"noreferrer noopener\">sys.dm_db_missing_index_details (Transact-SQL)<\/a><\/li>\n<\/ul>","protected":false},"excerpt":{"rendered":"<p>In a previous article we saw what indexes are. In this article we will see how to find the status of their hash, if you are using them, when they were created, when they were updated and if they are missing indexes recommended by SQL Server. What we must remember How we find the fragmentation of the indexes With the following script that I have [...]<\/p>","protected":false},"author":1,"featured_media":702,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,15],"tags":[29,49,23,48,6],"class_list":["post-2237","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-databases","category-ms-sqlserver","tag-databases","tag-indexes","tag-microsoft","tag-performance_tuning","tag-sqlserver"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dataplatform.gr\/en\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr\" \/>\n<meta property=\"og:description\" content=\"\u03a3\u03b5 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b5\u03af\u03c7\u03b1\u03bc\u03b5 \u03b4\u03b5\u03b9 \u03c4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03b1 indexes. \u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03c9\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 \u03c4\u03b9 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b2\u03c1\u03af\u03c3\u03ba\u03b5\u03c4\u03b1\u03b9 \u03bf \u03ba\u03b1\u03c4\u03b1\u03ba\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2 \u03c4\u03bf\u03c5\u03c2, \u03b1\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd\u03c4\u03b5, \u03c0\u03cc\u03c4\u03b5 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03b8\u03b7\u03ba\u03b1\u03bd, \u03c0\u03cc\u03c4\u03b5 \u03b5\u03bd\u03b7\u03bc\u03b5\u03c1\u03ce\u03b8\u03b7\u03ba\u03b1\u03bd \u03ba\u03b1\u03b9 \u03b1\u03bd \u03bb\u03b5\u03af\u03c0\u03bf\u03c5\u03bd indexes \u03c0\u03bf\u03c5 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server. \u03a4\u03b9 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b8\u03c5\u03bc\u03cc\u03bc\u03b1\u03c3\u03c4\u03b5 \u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf fragmentation \u03c4\u03c9\u03bd indexes \u039c\u03b5 \u03c4\u03bf \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 script \u03c0\u03bf\u03c5 \u03ad\u03c7\u03c9 [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dataplatform.gr\/en\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"DataPlatform.gr\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dataplatform.gr\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-09-19T04:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-10-16T11:42:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1280\" \/>\n\t<meta property=\"og:image:height\" content=\"720\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Stratos Matzouranis\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Stratos Matzouranis\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/\"},\"author\":{\"name\":\"Stratos Matzouranis\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\"},\"headline\":\"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server\",\"datePublished\":\"2022-09-19T04:00:00+00:00\",\"dateModified\":\"2024-10-16T11:42:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/\"},\"wordCount\":144,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"keywords\":[\"Databases\",\"Indexes\",\"Microsoft\",\"Performance Tuning\",\"SQL Server\"],\"articleSection\":[\"Databases\",\"Microsoft SQL Server\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/\",\"name\":\"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"datePublished\":\"2022-09-19T04:00:00+00:00\",\"dateModified\":\"2024-10-16T11:42:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_sqlserver.png\",\"width\":1280,\"height\":720},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Databases\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"Microsoft SQL Server\",\"item\":\"https:\\\/\\\/www.dataplatform.gr\\\/category\\\/databases\\\/ms-sqlserver\\\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#website\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"name\":\"dataplatform.gr - Sky is not the limit!\",\"description\":\"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dataplatform.gr\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#organization\",\"name\":\"dataplatform.gr\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"contentUrl\":\"https:\\\/\\\/www.dataplatform.gr\\\/wp-content\\\/uploads\\\/2020\\\/06\\\/dp_logo_wbacki.png\",\"width\":322,\"height\":139,\"caption\":\"dataplatform.gr\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dataplatform.gr\\\/\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dataplatform-gr\\\/\"]},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dataplatform.gr\\\/#\\\/schema\\\/person\\\/e87bf4fd02b65cb6aa0942f87245bbaf\",\"name\":\"Stratos Matzouranis\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g\",\"caption\":\"Stratos Matzouranis\"},\"sameAs\":[\"https:\\\/\\\/www.dataplatform.gr\"],\"url\":\"https:\\\/\\\/www.dataplatform.gr\\\/en\\\/author\\\/stratos-matzouranis\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dataplatform.gr\/en\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr","og_description":"\u03a3\u03b5 \u03c0\u03c1\u03bf\u03b7\u03b3\u03bf\u03cd\u03bc\u03b5\u03bd\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b5\u03af\u03c7\u03b1\u03bc\u03b5 \u03b4\u03b5\u03b9 \u03c4\u03b9 \u03b5\u03af\u03bd\u03b1\u03b9 \u03c4\u03b1 indexes. \u03a3\u03b5 \u03b1\u03c5\u03c4\u03cc \u03c4\u03bf \u03ac\u03c1\u03b8\u03c1\u03bf \u03b8\u03b1 \u03b4\u03bf\u03cd\u03bc\u03b5 \u03c0\u03c9\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c3\u03b5 \u03c4\u03b9 \u03ba\u03b1\u03c4\u03ac\u03c3\u03c4\u03b1\u03c3\u03b7 \u03b2\u03c1\u03af\u03c3\u03ba\u03b5\u03c4\u03b1\u03b9 \u03bf \u03ba\u03b1\u03c4\u03b1\u03ba\u03b5\u03c1\u03bc\u03b1\u03c4\u03b9\u03c3\u03bc\u03cc\u03c2 \u03c4\u03bf\u03c5\u03c2, \u03b1\u03bd \u03c7\u03c1\u03b7\u03c3\u03b9\u03bc\u03bf\u03c0\u03bf\u03b9\u03bf\u03cd\u03bd\u03c4\u03b5, \u03c0\u03cc\u03c4\u03b5 \u03b4\u03b7\u03bc\u03b9\u03bf\u03c5\u03c1\u03b3\u03ae\u03b8\u03b7\u03ba\u03b1\u03bd, \u03c0\u03cc\u03c4\u03b5 \u03b5\u03bd\u03b7\u03bc\u03b5\u03c1\u03ce\u03b8\u03b7\u03ba\u03b1\u03bd \u03ba\u03b1\u03b9 \u03b1\u03bd \u03bb\u03b5\u03af\u03c0\u03bf\u03c5\u03bd indexes \u03c0\u03bf\u03c5 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server. \u03a4\u03b9 \u03c0\u03c1\u03ad\u03c0\u03b5\u03b9 \u03bd\u03b1 \u03b8\u03c5\u03bc\u03cc\u03bc\u03b1\u03c3\u03c4\u03b5 \u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03bf fragmentation \u03c4\u03c9\u03bd indexes \u039c\u03b5 \u03c4\u03bf \u03c0\u03b1\u03c1\u03b1\u03ba\u03ac\u03c4\u03c9 script \u03c0\u03bf\u03c5 \u03ad\u03c7\u03c9 [&hellip;]","og_url":"https:\/\/www.dataplatform.gr\/en\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/","og_site_name":"DataPlatform.gr","article_publisher":"https:\/\/www.facebook.com\/dataplatform.gr\/","article_published_time":"2022-09-19T04:00:00+00:00","article_modified_time":"2024-10-16T11:42:35+00:00","og_image":[{"width":1280,"height":720,"url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","type":"image\/png"}],"author":"Stratos Matzouranis","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Stratos Matzouranis","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#article","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/"},"author":{"name":"Stratos Matzouranis","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf"},"headline":"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server","datePublished":"2022-09-19T04:00:00+00:00","dateModified":"2024-10-16T11:42:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/"},"wordCount":144,"commentCount":0,"publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","keywords":["Databases","Indexes","Microsoft","Performance Tuning","SQL Server"],"articleSection":["Databases","Microsoft SQL Server"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/","url":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/","name":"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server - DataPlatform.gr","isPartOf":{"@id":"https:\/\/www.dataplatform.gr\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#primaryimage"},"image":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","datePublished":"2022-09-19T04:00:00+00:00","dateModified":"2024-10-16T11:42:35+00:00","breadcrumb":{"@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#primaryimage","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_sqlserver.png","width":1280,"height":720},{"@type":"BreadcrumbList","@id":"https:\/\/www.dataplatform.gr\/pos-vriskoyme-tin-apodosi-ton-indexes-ston-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0391\u03c1\u03c7\u03b9\u03ba\u03ae","item":"https:\/\/www.dataplatform.gr\/"},{"@type":"ListItem","position":2,"name":"Databases","item":"https:\/\/www.dataplatform.gr\/category\/databases\/"},{"@type":"ListItem","position":3,"name":"Microsoft SQL Server","item":"https:\/\/www.dataplatform.gr\/category\/databases\/ms-sqlserver\/"},{"@type":"ListItem","position":4,"name":"\u03a0\u03ce\u03c2 \u03b2\u03c1\u03af\u03c3\u03ba\u03bf\u03c5\u03bc\u03b5 \u03c4\u03b7\u03bd \u03b1\u03c0\u03cc\u03b4\u03bf\u03c3\u03b7 \u03c4\u03c9\u03bd \u03c5\u03c0\u03b1\u03c1\u03c7\u03cc\u03bd\u03c4\u03c9\u03bd Indexes \u03ba\u03b1\u03b9 \u03c0\u03bf\u03af\u03b1 \u03ba\u03b1\u03b9\u03bd\u03bf\u03cd\u03c1\u03b3\u03b9\u03b1 Indexes \u03bc\u03b1\u03c2 \u03c0\u03c1\u03bf\u03c4\u03b5\u03af\u03bd\u03b5\u03b9 \u03bf SQL Server"}]},{"@type":"WebSite","@id":"https:\/\/www.dataplatform.gr\/#website","url":"https:\/\/www.dataplatform.gr\/","name":"dataplatform.gr - Sky is not the limit!","description":"\u0398\u03b5\u03c9\u03c1\u03af\u03b1, \u03bf\u03b4\u03b7\u03b3\u03bf\u03af \u03ba\u03b1\u03b9 \u03c3\u03ba\u03ad\u03c8\u03b5\u03b9\u03c2 \u03b3\u03b9\u03b1 \u03bd\u03b1 \u03ba\u03ac\u03bd\u03b5\u03c4\u03b5 \u03c4\u03b7 \u03b4\u03bf\u03c5\u03bb\u03b5\u03b9\u03ac \u03c3\u03b1\u03c2 \u03c0\u03b9\u03bf \u03c0\u03b1\u03c1\u03b1\u03b3\u03c9\u03b3\u03b9\u03ba\u03ac \u03ba\u03b1\u03b9 \u03c0\u03b9\u03bf \u03b5\u03cd\u03ba\u03bf\u03bb\u03b1 \u03c0\u03ac\u03bd\u03c9 \u03c3\u03c4\u03b9\u03c2 \u03b2\u03ac\u03c3\u03b5\u03b9\u03c2 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03c9\u03bd, \u03c3\u03c4\u03b7\u03bd SQL, \u03c3\u03c4\u03bf Business Intelligence \u03ba\u03b1\u03b9 \u03c3\u03c4\u03b1 \u03b4\u03b5\u03b4\u03bf\u03bc\u03ad\u03bd\u03b1 \u03b3\u03b5\u03bd\u03b9\u03ba\u03cc\u03c4\u03b5\u03c1\u03b1.","publisher":{"@id":"https:\/\/www.dataplatform.gr\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dataplatform.gr\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dataplatform.gr\/#organization","name":"dataplatform.gr","url":"https:\/\/www.dataplatform.gr\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/","url":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","contentUrl":"https:\/\/www.dataplatform.gr\/wp-content\/uploads\/2020\/06\/dp_logo_wbacki.png","width":322,"height":139,"caption":"dataplatform.gr"},"image":{"@id":"https:\/\/www.dataplatform.gr\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dataplatform.gr\/","https:\/\/www.linkedin.com\/company\/dataplatform-gr\/"]},{"@type":"Person","@id":"https:\/\/www.dataplatform.gr\/#\/schema\/person\/e87bf4fd02b65cb6aa0942f87245bbaf","name":"Stratos Matzouranis","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ab973bc4bd1673c43d45de5633a624d9ad13c06902dfdd5a6e3fd9885903865e?s=96&d=mm&r=g","caption":"Stratos Matzouranis"},"sameAs":["https:\/\/www.dataplatform.gr"],"url":"https:\/\/www.dataplatform.gr\/en\/author\/stratos-matzouranis\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2237","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/comments?post=2237"}],"version-history":[{"count":9,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2237\/revisions"}],"predecessor-version":[{"id":5837,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/posts\/2237\/revisions\/5837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media\/702"}],"wp:attachment":[{"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/media?parent=2237"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/categories?post=2237"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dataplatform.gr\/en\/wp-json\/wp\/v2\/tags?post=2237"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}