stonexu1984
New member
- Local time
- Today, 12:33
- Joined
- Mar 26, 2009
- Messages
- 3
my access database contains over 3million rows and the size will be increasing. it's used to store the history price of stocks. The problem,as I mentioned, is the speed for exporting. it takes
1: 30secs for 2300 dates * 1 stock
2: 1 min for 250 dates * 25 stocks
3: 5.5 mins for 7200 dates * 5 stocks
4: 5 mins for 1300 dates * 25 stocks
5: 30 mins for 300 dates * 100 stocks
The vba code runs a dates loop first, so for each date, SQL gets the price for all the stocks for that day, and then the 2nd loop puts the price into the corresponding cell, then go to next day.
I've also tried this way, run stock loop first then date loop, put in 1 cell by 1 cell, but this is much slower.
The reason i insist on doing this day by day is: the date is downloaded form Bloomberg and only contains price in trading days. however, stocks, currencys and futures don't have same trading days.
It seems it takes more time to deal with large scale matrix. and the query gets 1 day * 100 stocks is slower than query gets 100 days * 1 stock.
I am not sure if it's the access problem, since if so i would switch to SQLserver + VB.net, maybe that could be faster?
MY PC: E8400 2.99GHz 1.98G ram
1: 30secs for 2300 dates * 1 stock
2: 1 min for 250 dates * 25 stocks
3: 5.5 mins for 7200 dates * 5 stocks
4: 5 mins for 1300 dates * 25 stocks
5: 30 mins for 300 dates * 100 stocks
The vba code runs a dates loop first, so for each date, SQL gets the price for all the stocks for that day, and then the 2nd loop puts the price into the corresponding cell, then go to next day.
I've also tried this way, run stock loop first then date loop, put in 1 cell by 1 cell, but this is much slower.
The reason i insist on doing this day by day is: the date is downloaded form Bloomberg and only contains price in trading days. however, stocks, currencys and futures don't have same trading days.
It seems it takes more time to deal with large scale matrix. and the query gets 1 day * 100 stocks is slower than query gets 100 days * 1 stock.
I am not sure if it's the access problem, since if so i would switch to SQLserver + VB.net, maybe that could be faster?
MY PC: E8400 2.99GHz 1.98G ram
Last edited: