Results 1 to 22 of 22

Thread: Help in accessing 6M+ records.

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24

    Unhappy

    Good Day!

    I have a program which accesses an Access2000 database
    which consists of 6 million plus records(and still growing..) in a single table. It takes more than 30 mins. to do a SELECT statement eventhough the database is in the local computer's hard disk. The SELECT statement's criteria is a date range and I don't think making the date field an index will help either. The archiving for this database is annually and the 6 million records are only for the months Jan.-June! The program by the way, is a Serial Number checker, you input a serial number and it checks if that serial number already exists in the database. I don't
    think that dividing the single Table into smaller tables (on a per month basis) will help since the program must search for all the records in a whole year! Basically, this program's main functions are Search and Generate data. I'm using ADODB.Recordset.

    Is there any solution to this problem? Please note that I will still use the current setup(i.e. the program will execute an SQL statement on a local database on a local computer).

    Your comments are highly appreciated.

  2. #2
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    I am by no means an expert on databases but this is just an idea.

    What about two tables. One that holds all of the serial numbers and nothing else. The other table holdsall of the data, with the primary key being the foregin key in the other table.

    That may be quicker for checking if serial numbers exist, though i am not sure.
    Iain, thats with an i by the way!

  3. #3
    Fanatic Member
    Join Date
    Mar 2000
    Location
    That posh bit of England known as Buckinghamshire
    Posts
    658
    An extension on my last thought.

    You could divide up the serial numbers. Sort of index them

    e.g.

    table 1

    10001234
    10001235
    10001236
    --------

    table 2

    11001234
    11001235
    --------

    table 3

    12001234


    In your program you store the range of each table as a constant. Then when you need to check for a serial number you check a much reduced table.

    And when you add one, you make sure you insert it in the correct table.

    Just a thought.
    Iain, thats with an i by the way!

  4. #4

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24

    Wink

    lain17

    Ok, i'll check it out...but how about the Generating part of the program? The SQL's criteria is a date range (eg SELECT * FROM MyTable WHERE TDate BETWEEN #01/01/2000# AND #06/01/2000#).

  5. #5
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    This could be a dumb question, but is the DB indexed? you can create indexes on any or all tables which dramatically increases search time (adds to the file size a little though)

    No chance of throwing it into SQL server 7?

    At work our billing system is on SQL7.x and the improvement (even over MSSQL 6.5) is huge, searches in fields that are indexed for tables with millions of records take seconds even though the DB is live with software writing to it heavily, I have ASP files that call records based on account number almost instantly. the server just runs on a PC NT system. Searches on non-indexed fields takes a while though.

    If you had stored proceedures then performance increases again

    If it's important, go to sql server, it's a piece of piss to administer too, any joe average with a 10 minute guide could create a DB and import from access with it.

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  6. #6
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    paul282's right, SQL 7 is a doddle to administer (and it looks v.good on your CV).

    Is your DB in 3NF? If not it really should be as this is the whole point of relational DBs. This will speed it up hugely.




    VB6 Enterprise sp5, SQL Server2000

  7. #7

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24

    Paul282,
    Yes, the database is indexed particularly the SerialNumber field and the Date field. Regarding the SQL Server, the company I'm working for does not have the resources to setup one.
    Thanks for the info though.

  8. #8
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    Zeee,

    You don't have to use the enterprise vn of sql7, you can use the desktop vn.
    VB6 Enterprise sp5, SQL Server2000

  9. #9

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24
    frank ashley,
    What's a 3NF?

  10. #10
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    1 Winnt PC, normal home user spec ($1-2k max)

    how big is the company?
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  11. #11
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    3NF - Third Normal Form.

    Its another TLA thats fantastic to use.

    In short, 3nf is the process of separating your data into tables so that each table holds values that are similar, they will therefore be smaller.
    VB6 Enterprise sp5, SQL Server2000

  12. #12

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24

    Paul282,
    The company who hired me to develop this program is just a small data processing firm with no networking capabilities.


    frank ashley,
    3NF is one of the processes you use in normalization or data modeling right? BTW, what's TLA?

  13. #13
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    We don't really have control of our schema for that system, the telephony hardware vendor dictates that. It's adequate but we would have preferred Oracle on Solaris (Oracle on NT is not that special but it's apparently pretty good on solaris)

    Zee, Question.

    Access can have a bit of a problem with Memory when the DB get's too big, does the Hard disk work hard (paging) when the select statement is running? If so try upping the system memory and VM of the system. Maybe borrow some from another system temporarily to see if the speed increase justifies the cost of the memory.

    How much memory is in the system and how big is the mdb file?

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  14. #14

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24


    Paul282,
    The system memory is 64MB while the database size is 764MB.

  15. #15
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    No chance of taking that to 256?
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  16. #16
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    Zee,

    yes, db in 3nf = normalised db

    A db with one table and 6m+ recs in that table doesn't sound right to me.

    tla = three letter acronym!

    Isn't there an option in Access to 'compress' the db. Have you tried that?




    VB6 Enterprise sp5, SQL Server2000

  17. #17
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    Zee,

    You don't have to have a networked pc in order to run sql7 desktop.

    I run it at home myself, first on w98 then on nt4 now on w2000.


    VB6 Enterprise sp5, SQL Server2000

  18. #18
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840

    Thumbs down

    don't compress the DB in access, it'll slow it down.

    RAM RAM RAM! There's no such thing as too much RAM !

    What's the DB schema? Columns, and datatypes?
    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  19. #19
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    paul282,

    as an aside, I thought that 'compress' in access would remove all the crap, or does it 'zip' up stuff?

    i don't use access so i'm just curious


    VB6 Enterprise sp5, SQL Server2000

  20. #20
    Fanatic Member
    Join Date
    Feb 2000
    Location
    Japan
    Posts
    840
    To be honest I haven't bothered to read the help! I just always assumed that it was data compression on the mdb file. If it was just removing white space and fragmentation then I guess you would see improvement.

    Still from the description the DB only get's written to in large blocks and no constant updates or deletes so fragmentation would be minimal. (although HDD fragmentation would kill performance, so that should be checked)

    I'm a little suspicious of the indexes, if in the right place the effect should be large. A select statement on a few rows in 6 million still shouldn't take more than a couple for minutes in access.

    Still think they'd be better of with NT and SQL server. You don't need a network for that. 128MB ram would be nice though.

    Paul Dwyer
    Network Engineer
    Aussie In Tokyo

    Using Powerbasic 6 & VB6 SP4 (Please also add your VB Version to your signature!)

  21. #21

    Thread Starter
    Junior Member
    Join Date
    Jun 2000
    Location
    Philippines
    Posts
    24

    Lightbulb


    Everyone,
    Basing on your feedbacks, I think I'll try using SQL 7(desktop version, I assume its the same as the one bundled with Office 2000 right?) and install it in the local machine. To add, can you tell me any sites where I can get instructions on how to set-up SQL 7.....I really need the info....Thanks a lot to all those who shared their thoughts.....

  22. #22
    Lively Member
    Join Date
    May 2000
    Location
    London
    Posts
    99
    Where I am (UK) I don't think that sql7 is bundled with office2k.

    What you might be referring to is MSDE. This is the sql data engine. This doesn't come with the fancy front end (enterprise manager) which makes everything drag/drop, cut/paste etc.

    Installing sql7 is a breeze, don't worry.

    Good luck & have a nice weekend.


    VB6 Enterprise sp5, SQL Server2000

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width