I have a database table with more than 50 million records, and to improve the search I had to create indexes without clustering, and as soon as I create them, it takes 5-10 minutes to create, so I think that in the background Sorts data by index.
So, for example, before adding an index to my search, the table was awful and time consuming, and when I added a non-clustered index, the search was quick.
But that was only when I had 50 million records.
The question is, what if I defined the index at the very beginning when creating the table before adding any data to the table? Will he give the same search results as now? or do I need to delete and recreate the index from time to time to sort the data?
I'm sorry if my question seemed stupid, I just started to study indexes, and this is a confusing topic for me.
source
share