My indexes are shown in random numbered rows in sys.indexes table, mixed with system indexes. Now I want to write a select statement to choose only indexes created by me. (like I can do for databases 'where database_id > 4' in sys.databases) Here, index_id has different meaning and is not unique. Can someone help me? Thanks for your time.
Not sure exactly what you are up to, but if you're wanting generic maintenance scripts then you can't go wrong with https://ola.hallengren.com/. I'm sure they could be tailored to your precise requirements.