Quantcast
Channel: SQL Server Database Engine forum
Viewing all articles
Browse latest Browse all 5123

index fragmentation versus no index

$
0
0

Hi,

So, as we know depending on the size of the table, defrag is not necessarily the best :)

Now, I was wondering between fragmented indexes and no index at all. Typically, I have the following:

page_count     nameavg_fragmentation_in_percent
433    IX_msg_queue_process_id_comm_to97.45958
202    IX_msg_id_process_id_comm_to97.0297
35125    IX_log_engine_process_id76.88826
112166    IX_msg_type_status_style_version64.10677

So the first 2, they are highly fragmented but the tables are small

IX_msg_queue_process_id_comm_to, IX_msg_id_process_id_comm_to are on a table containing 5k rows for about 15 MB of data. IX_msg_id_process_id_comm_to

IX_log_engine_process_id is on a table containing 4.4 million rows for about 4 GB of data.

IX_msg_type_status_style_version is on a table containing 16 million rows for about 162 GB of data

Index operational stats:

OBJECT NAMEINDEX NAMELEAF_INSERT_COUNTLEAF_UPDATE_COUNTLEAF_DELETE_COUNT
msgIX_msg_type_status_style_version35648500
msg_queueIX_msg_id_process_id_comm_to5889800
msg_queueIX_msg_queue_process_id_comm_to591021669680
log_engineIX_log_engine_process_id8375600

Index usage stats:

OBJECT NAMEINDEX NAMEUSER_SEEKSUSER_SCANSUSER_LOOKUPSUSER_UPDATES
msgIX_msg_type_status_style_version1870900425600
log_engineIX_log_engine_process_id00052386
msg_queueIX_msg_queue_process_id_comm_to6692710359342
msg_queueIX_msg_id_process_id_comm_to000117914

To me, I would have better performances if I would drop these 3:

IX_msg_type_status_style_version, highly fragmented, somewhat used but has been pretty much deprecated

IX_log_engine_process_id, rarely used and usually only when we do manually query on the engine log table

IX_msg_id_process_id_comm_to, table is super small and never used so I would call this one a definite yes

But in a more general aspect, is there a rule of thumbs as to what point an index becomes pretty much worthless. Especially when they are rebuilt nightly and get 90%+ fragmentation levels after a 3 hours of normal loads.

Thanks for any insight / good papers links on this.

Note: Fragmentation is due to how the application operates at the moment and it won't be fixed for at least a year or 2.


Viewing all articles
Browse latest Browse all 5123

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>