J
John Kounis
I recently converted from a .mdb file to an .adp frontend (via OLE DB
Provider) for a SQL database. In this database, I have a large table with
750,000 customer transactions where there's a debit/credit amount column and
a balance column. Every so often, the balance gets out of sync, so I run a
periodic maintenance program to correct the customer balances. It is
something like:
rstHistory.CacheSize = <some small number>
rst.Open " SELECT * FROM [TransactionTable with 750,000 rows] ORDER BY
TransactionID", _
CurrentProject.Connection, _
adOpenForwardOnly, adLockPessimistic, adAsyncFetch
While Not rst.EOF
[process a row]
Wend
rst.close
The process is order of magnitudes slower on the ADP database than it ever
was in the .mdb file. The problem seems to be that the "rst.Open" statement
is trying to process all 750,000 rows, which takes a lot of resources.
Since I've specified "adOpenForwardOnly" and a small cachesize, I thought
that this process would only process 1 row at a time. That's what it does in
the .MDB file, which is pretty fast. However, now, in the .ADP file, it
apparently needs to cache all 750,000 rows. It takes a long time to return,
and the bogs down the server incredibly (eventually, the server memory usage
exceeds the physical memory installed, and it starts swapping virtual memory
like crazy and slows to a crawl).
I've tried setting rst.CursorLocation to both adUseClient and adUseServer.
This just moves the problem to either the client or the server, but it
doesn't solve the problem. I've tried different combinations of asynchronous
and synchronous operations, too -- all with the same result.
Is there any way to just process 1 row at a time, or 100, or 1,000... just
not all 750,000 rows at once? My process goes sequentially through the rows,
so I don't need all at once.
Thanks,
John Kounis
Provider) for a SQL database. In this database, I have a large table with
750,000 customer transactions where there's a debit/credit amount column and
a balance column. Every so often, the balance gets out of sync, so I run a
periodic maintenance program to correct the customer balances. It is
something like:
rstHistory.CacheSize = <some small number>
rst.Open " SELECT * FROM [TransactionTable with 750,000 rows] ORDER BY
TransactionID", _
CurrentProject.Connection, _
adOpenForwardOnly, adLockPessimistic, adAsyncFetch
While Not rst.EOF
[process a row]
Wend
rst.close
The process is order of magnitudes slower on the ADP database than it ever
was in the .mdb file. The problem seems to be that the "rst.Open" statement
is trying to process all 750,000 rows, which takes a lot of resources.
Since I've specified "adOpenForwardOnly" and a small cachesize, I thought
that this process would only process 1 row at a time. That's what it does in
the .MDB file, which is pretty fast. However, now, in the .ADP file, it
apparently needs to cache all 750,000 rows. It takes a long time to return,
and the bogs down the server incredibly (eventually, the server memory usage
exceeds the physical memory installed, and it starts swapping virtual memory
like crazy and slows to a crawl).
I've tried setting rst.CursorLocation to both adUseClient and adUseServer.
This just moves the problem to either the client or the server, but it
doesn't solve the problem. I've tried different combinations of asynchronous
and synchronous operations, too -- all with the same result.
Is there any way to just process 1 row at a time, or 100, or 1,000... just
not all 750,000 rows at once? My process goes sequentially through the rows,
so I don't need all at once.
Thanks,
John Kounis