My goal is to list all indexes that are being used on each feature class in an SDE database with ~50 feature classes that reside, with the end product being a list of the feature class and what the name of the index is.
<SPAN class="keyword token">import</SPAN> arcpy
arcpy<SPAN class="punctuation token">.</SPAN>env<SPAN class="punctuation token">.</SPAN>workspace <SPAN class="operator token">=</SPAN> r<SPAN class="string token">"Database Connections\Server Database Login.sde"</SPAN>
<SPAN class="comment token"># Get list of indexes and print properties</SPAN>
FCs <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListFeatureClasses<SPAN class="punctuation token">(</SPAN><SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> FC <SPAN class="keyword token">in</SPAN> FCs<SPAN class="punctuation token">:</SPAN>
indexes <SPAN class="operator token">=</SPAN> arcpy<SPAN class="punctuation token">.</SPAN>ListIndexes<SPAN class="punctuation token">(</SPAN>FC<SPAN class="punctuation token">)</SPAN>
<SPAN class="keyword token">for</SPAN> index <SPAN class="keyword token">in</SPAN> indexes<SPAN class="punctuation token">:</SPAN>
<SPAN class="keyword token">print</SPAN> FC
<SPAN class="keyword token">print</SPAN><SPAN class="punctuation token">(</SPAN><SPAN class="string token">"Name : {0}"</SPAN><SPAN class="punctuation token">.</SPAN>format<SPAN class="punctuation