Re: Which is faster--Array or ADO
- From: "vanderghast" <vanderghast@com>
- Date: Thu, 25 Jun 2009 17:09:34 -0400
Depends of your join and of your need.
Any solution based on 'data lives in memory' is hardly multi-users friendly: if data change, you need to resych it, not necessary trivial.
There is also two opposite 'ways' of doing it: the first one that I will call the DAO way, just to give it a name, would be to create bookmarks for each row in the result of the join, and here that can make up to 3.5G rows if you use a Cartesian join ( 3.5G = 70K times 50K ). Clearly, the whole data (of the join) may not fit in committed memory, AND you may end up with multiple duplicates Disk IO, when you navigate over this monster, that is, reading the same initial row of one of the table, multiple times from DISK (which is slower than reading cached data in memory) . The other way, let us call it, ADONet, again, just to give a name to it, would be to read each table, locally, so taking only 120K of committed memory ( = 70K + 50K), and 'make' the join locally, such as looping over each table now in memory (explicit looping or using some other mechanism, call it LINQ or by other name, it does not really matter for the illustration). That solution will be much faster than the first, since any INITIAL row would only be read ONLY ONCE, but YOU may have to add additionnal functionnality, all by yourself, which may introduce additionnal more or less complex behaviors (lock, update/delete/append/resynch, etc).
In fact, your "array" solution is close to the one I called ADONet, but you have to add the join mechanism, yourself, which can be easy, or very difficult, depending on your EXACT scenario.
Vanderghast, Access MVP
"RLN60" <RLN60@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message news:2638FC5E-5F94-45BA-AAEC-0628D2EDF020@xxxxxxxxxxxxxxxx
RE: Access 2007
I have 70k rows in one table and about 50k rows in another table. They are
joined together via proper keys and are indexed. I need to load them into
either an Array or and ADO recordset, do a bunch of processing then create an
Excel export and wanted to know which is faster:
1) Loading 70k rows from a table into an ADO recordset and working with it
in ADO
2) Loading 70k rows from a table into an Array and working with it in the
array.
I would like to know a bit about the theory behind why one would be faster
than another. Arrays are in RAM. Is the ADO recordset in RAM also?
Thanks.
.
- References:
- Which is faster--Array or ADO
- From: RLN60
- Which is faster--Array or ADO
- Prev by Date: Re: "Build" expression in Query
- Next by Date: QueryByForm Approach
- Previous by thread: Re: Which is faster--Array or ADO
- Next by thread: Re: Which is faster--Array or ADO
- Index(es):
Relevant Pages
|