G
Guest
Hi,
While doing some experimenting I noticed that using CurrentDb to reach
linked tables instead of separately opening a new connection to that database
results in much slower queries. When I say slower I mean A LOT.
Tests, all 200 varchar(50) field inserts and an autonumber primary key:
ADO write: 266ms
ADO write contained in transaction: 109ms
DAO write using CurrentDb: 1578ms
DAO write using CurrentDb cotained in transaction: 625ms
DAO write using new connection in workspace: 78ms
DAO write using new connection in workspace, contained in transaction: 47ms
DAO write using a Table-recordset for inserts: 16ms
This result really surprised me on two fronts:
- First of all using the already opened CurrentDb results in SERIOUS
slowdown for some reason. Apparently opening a separate connection is much
faster despite the opening and closing.
- Secondly using a recordset seems to be significantly faster than running a
query directly against the database, despite the expected overhead.
Can anyone direct me to a document outlining what happens behind the
curtains, explaining why I come up with these results? Is it correct that the
absolute fastest way to do bulk inserts on a linked table is using a separate
connection to that backend and use a Table recordset to do the inserts? Or is
there a faster way to do this?
Hope someone can shed some light on this.
Regards,
Dirk Louwers
While doing some experimenting I noticed that using CurrentDb to reach
linked tables instead of separately opening a new connection to that database
results in much slower queries. When I say slower I mean A LOT.
Tests, all 200 varchar(50) field inserts and an autonumber primary key:
ADO write: 266ms
ADO write contained in transaction: 109ms
DAO write using CurrentDb: 1578ms
DAO write using CurrentDb cotained in transaction: 625ms
DAO write using new connection in workspace: 78ms
DAO write using new connection in workspace, contained in transaction: 47ms
DAO write using a Table-recordset for inserts: 16ms
This result really surprised me on two fronts:
- First of all using the already opened CurrentDb results in SERIOUS
slowdown for some reason. Apparently opening a separate connection is much
faster despite the opening and closing.
- Secondly using a recordset seems to be significantly faster than running a
query directly against the database, despite the expected overhead.
Can anyone direct me to a document outlining what happens behind the
curtains, explaining why I come up with these results? Is it correct that the
absolute fastest way to do bulk inserts on a linked table is using a separate
connection to that backend and use a Table recordset to do the inserts? Or is
there a faster way to do this?
Hope someone can shed some light on this.
Regards,
Dirk Louwers