Indexing and sorting

Maldrid

Registered User.
Local time
Today, 17:08
Joined
Jul 24, 2003
Messages
20
Indexing and sorting [Resolved]

This might sound ridculous but I want to make sure. I have a table where I have several fields set up as an index. So originally the table was sorted according to those indexes. Well I resorted the table based on one field because it make it easier for me to read. Then I saved it like that, does that screw up my indexes now, since the table was originally sorted using them? I am not sure exactly how indexes work, but I thought the table would be sorted according to the indexes so searching through a table using an index makes things quicker.
 
Last edited:
Tables are not sorted by index. Rows are stored physically "as added".

Indexes are used to find data. An index is basically an extra table with index key values that point to a physical record location.

So you have not screwed anything up by resorting the table. Access will remake the indexes.

RichM
 
Ah ok so that is how it works. Thanks for the help!!
 
I'll add one extra bit of clarification. When you open a table, whether sorted or not, you don't actually open it. You open a VIEW of it that retains any sort-order changes you impose. But the view is not the table.

As pointed out by RichM, an index is a separate entity that is independent. Actually, though, sorting the table DOESN'T change the indexes because nothing actually moves. The only thing that does happen is that the "implied view index" changes according to your sort rules.
 

Users who are viewing this thread

Back
Top Bottom