Results 1 to 9 of 9

Thread: Query Speed

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Angry

    I have an Access 97 database and to retrieve 500 records it takes about 6 minutes. This way to slow!

    I need to increase the speed of the query. I am using an Access database and I am using stricly code for my query no data control.


    Can anyone tell me where I can find some usefull information on query speed? I have a problem that I must fix urgently or I am out of a job!!


    If anyone has any strong suggestions on how to improve query speed then please let me know./..

    Stevie

  2. #2
    Lively Member
    Join Date
    Dec 1999
    Posts
    106
    Stevie,
    There is something really wrong here because that is way slow.
    - Is the database on a network?
    - What spec machine are you using?
    - Would it be possible to pull down less than 500 records at a go?
    - Can you use a readonly recordset?
    - Are you using DAO/ADO/RDO ?
    - Is the database properly normalized?

    If you post a bit more info it might be easier to help ..

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98
    The Database is actually on a web server. I am using strictly code. I am using a Win Nt OS on a Pentium 3.

    It just takes way too long....

    What I am doing is using Crystal Reports and to run a report on a query I run the query and take the snap shot and place it into a temp.mdb... this is probably what is causing the problem but it should not take this long


    Are there ways to improve a sql query...

  4. #4

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    The Actual SQL Statement

    Here is the actual sql statement:


    db.Execute "SELECT * INTO Times IN '" & strTempDb & "' FROM Times WHERE DatePerformed>=#" & Format(date1.Value, "mm/dd/yyyy") & "# AND DatePerformed<=#" & Format(date2.Value, "mm/dd/yyyy") & "#"

    from the db i want to pull out lastname, dateperformed, regularhours, overtimehours fields....


    This query takes a snap shot of the selected criteria and places it into a temp mdb...

  5. #5
    Addicted Member
    Join Date
    Oct 1999
    Location
    The Lone Star State
    Posts
    183

    Talking

    You can increase the speed of Crystal Reports by ensuring that the values in your "Where" clause are indexed on the database.

    Also, if you're just pulling a report, why write the data to another db?

    If you just want to copy from one db to another using DAO, try using a transaction and commit the records about every 100 or so. That should speed it up.

  6. #6

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Reply

    Thank you for the immediate response.
    I am not using a ODBC connection so if i run a query the db will lock. How do I index a db? Can you go into detail?

    Transaction I have heard of I will look this up....

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Question Index and Transaction

    Can anyone please explain indexing a database and how transaction works?

  8. #8
    Your Ad Here! Edneeis's Avatar
    Join Date
    Feb 2000
    Location
    Moreno Valley, CA (SoCal)
    Posts
    7,339
    He means that the field you are using in the WHERE statement should be an index or when the database was set up this field should have been made into an index, maybe not a primary key or anything but an index none the less.

  9. #9

    Thread Starter
    Lively Member
    Join Date
    Oct 2000
    Posts
    98

    Question Answered

    Thank you! You have made me a happy man. To increase the speed by 70%, I changed the Index property in Access 97 of the fields that I am using in my query....


    Case Closed*****

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