isladogs
MVP / VIP
- Local time
- Today, 18:45
- Joined
- Jan 14, 2017
- Messages
- 18,521
@Doc
Whilst agreeing with the general idea behind your post, that quote isn't quite correct. These appear to be the correct values:
Number of indexes in a table 32
Number of fields in an index 10
See:
https://support.office.com/en-us/article/access-specifications-0cf3c66f-9cf2-4e32-9568-98c1025bb47c
https://www.databasezone.com/techdocs/acclimit.html
EDIT:
The following is also an illustration of when indexing does not help.
I recently did a test on another forum to compare the time taken to update a large number of records (2.6 million) where around 20% of the records were null
The comparison was between using Len(fieldname)=0 and Nz(fieldname,"")="" to check for nulls.
The prediction by a forum user was that Len would be faster as VBA handles number more efficiently than strings
That was not the case. Nz was about 10% faster IN THIS TEST
I also decided to compare the times taken when the field was indexed compared to unindexed.
Indexing INCREASED the time to do the update from around 40s to 60s
So whilst indexing may speed up SEARCHES significantly, UPDATES will in many cases be MUCH slower
Access has a limit of 10 indexes per table (and a PK counts as one).
Whilst agreeing with the general idea behind your post, that quote isn't quite correct. These appear to be the correct values:
Number of indexes in a table 32
Number of fields in an index 10
See:
https://support.office.com/en-us/article/access-specifications-0cf3c66f-9cf2-4e32-9568-98c1025bb47c
https://www.databasezone.com/techdocs/acclimit.html
EDIT:
The following is also an illustration of when indexing does not help.
I recently did a test on another forum to compare the time taken to update a large number of records (2.6 million) where around 20% of the records were null
The comparison was between using Len(fieldname)=0 and Nz(fieldname,"")="" to check for nulls.
The prediction by a forum user was that Len would be faster as VBA handles number more efficiently than strings
That was not the case. Nz was about 10% faster IN THIS TEST
I also decided to compare the times taken when the field was indexed compared to unindexed.
Indexing INCREASED the time to do the update from around 40s to 60s
So whilst indexing may speed up SEARCHES significantly, UPDATES will in many cases be MUCH slower
Last edited: