As promised, folks.
Table - local table containing ~100k records with all the fields listed below
Query - based on table + showing all fields
Order By On Load - No (Table and Query)
Timer - high res timer with a precision of ~100 microseconds
Field1 - AutoNumber, Indexed
Field2 - Text, Indexed
Field3 - Number
Field4 - Date
Test Cases:
1. CompileQ: Opening a recordset with a query name.
2. CodeQ: Opening a recordset with a SELECT statement of the table.
3. QuerydefQ: Opening a recordset from a querydef.
Scenario 1: No sort or filter applied, dbOpenSnapshot (as above)
The following scenarios are results that have been averaged out. Take note of of the recordset type.
I would imagine that there will be performance differences if the same tests are performed on linked tables and it would also vary on the source of the linked table.
Table - local table containing ~100k records with all the fields listed below
Query - based on table + showing all fields
Order By On Load - No (Table and Query)
Timer - high res timer with a precision of ~100 microseconds
Field1 - AutoNumber, Indexed
Field2 - Text, Indexed
Field3 - Number
Field4 - Date
Test Cases:
1. CompileQ: Opening a recordset with a query name.
Code:
CurrentDb.OpenRecordset("QueryName", dbOpenSnapshot)
Code:
CurrentDb.OpenRecordset("SELECT * FROM TableName", dbOpenSnapshot)
Code:
CurrentDb.Querydefs("QueryName").OpenRecordset(dbOpenSnapshot)
Scenario 1: No sort or filter applied, dbOpenSnapshot (as above)
Code:
CompiledQ: 1 0.0019
CompiledQ: 2 0.0029
CompiledQ: 3 0.002
CompiledQ: 4 0.0031
CompiledQ: 5 0.0028
CompiledQ: 6 0.0026
CompiledQ: 7 0.0028
CompiledQ: 8 0.0019
CompiledQ: 9 0.0029
CompiledQ: 10 0.0022
Average: 0.0025
CodeQ: 1 0.0017
CodeQ: 2 0.0019
CodeQ: 3 0.0017
CodeQ: 4 0.0014
CodeQ: 5 0.002
CodeQ: 6 0.0017
CodeQ: 7 0.0019
CodeQ: 8 0.0017
CodeQ: 9 0.0018
CodeQ: 10 0.0019
Average: 0.0018
QuerydefQ: 1 0.0035
QuerydefQ: 2 0.004
QuerydefQ: 3 0.0033
QuerydefQ: 4 0.0037
QuerydefQ: 5 0.0034
QuerydefQ: 6 0.0052
QuerydefQ: 7 0.0035
QuerydefQ: 8 0.0033
QuerydefQ: 9 0.0035
QuerydefQ: 10 0.0033
Average: 0.0036
The following scenarios are results that have been averaged out. Take note of of the recordset type.
Code:
Scenario 2: Field2 (Text, Indexed) ASC, Field4 (Date) ASC, dbOpenSnapshot
CompiledQ: 0.3721
CodeQ: 0.4085
QuerydefQ: 0.3736
Scenario 3: No sort or filter applied, dbOpenDynaset
CompiledQ: 0.0028
CodeQ: 0.0018
QuerydefQ: 0.0038
Scenario 4: Field2 (Text, Indexed) ASC, Field4 (Date) ASC, dbOpenDynaset
CompiledQ: 0.2762
CodeQ: 0.2890
QuerydefQ: 0.2550
Last edited: