Page 2 of 2 FirstFirst 12
Results 16 to 21 of 21
  1. #16
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    you apply indexes to fields that are used in joins or criteria. You also apply them to fields you frequently search, filter or sort on. Note it is not worth applying indexes to fields such a yes/no because it is ineffective. This link may give you a better understanding of indexing https://www.access-programmers.co.uk...26&postcount=1



    with regards your query, perhaps carrier_code as well. and maybe classification code. Now you have something that executes in a short period of time, experiment a bit, add an index rerun and time the query.

    Note that now you have added indexes, if your table is block populated (i.e. big dump of data from somewhere else) this will take longer, if too long a tip is to remove the indexes, add your data in and reinstate the indexes - all easily done with code

  2. #17
    NSearch is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    62
    I have been experimenting with the indexes and the query is now returning in 2 seconds!!

  3. #18
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    A lot better than the 70% I suggested. Is that 2 secs to see the recordcount at the bottom?

    Some years ago I had a client who built their own complex query for something and it took about an (acceptable for them) hour to run. As the dataset grew it got to the stage they would set the query running before they went home of an evening and it would finish soon after they got in the following morning. Then it starting taking to lunchtime - so around 20 hours! I was doing something else for them and they asked me to look at it. Tweaking here and there I got it down to 20 minutes. So it is always worth experimenting

  4. #19
    isladogs's Avatar
    isladogs is offline Access MVP / VIP
    Windows 10 Access 2010 32bit
    Join Date
    Jan 2014
    Location
    Somerset, UK
    Posts
    6,204
    Here's another link you may find useful ....http://www.mendipdatasystems.co.uk/s...s-8/4594556613
    Colin Riddington, Access MVP, Website, email
    The more I learn, the more I know I don't know. When I know I don't know, I keep quiet!

  5. #20
    NSearch is offline Advanced Beginner
    Windows 10 Access 2007
    Join Date
    Mar 2019
    Posts
    62
    Quote Originally Posted by Ajax View Post
    A lot better than the 70% I suggested. Is that 2 secs to see the recordcount at the bottom?

    Some years ago I had a client who built their own complex query for something and it took about an (acceptable for them) hour to run. As the dataset grew it got to the stage they would set the query running before they went home of an evening and it would finish soon after they got in the following morning. Then it starting taking to lunchtime - so around 20 hours! I was doing something else for them and they asked me to look at it. Tweaking here and there I got it down to 20 minutes. So it is always worth experimenting
    2 seconds for the entire record set to return! Really awesome!

    In some larger data sets that I am going to get into, I am sure it would have taken hours!

  6. #21
    CJ_London is online now VIP
    Windows 10 Access 2010 32bit
    Join Date
    Mar 2015
    Posts
    11,928
    2 seconds for the entire record set to return! Really awesome!
    goes to show the power of indexing. By my calculation if it was taking 7 mins before that is around 200 times faster. If you haven't done so, take a look at Colin's link, it demonstrates different ways of achieving the same result with differing degrees of performance. Be aware that it is based on a specific dataset. With different types of datasets, different volumes, different datatypes you may get different comparative performances - although appalling bad will always be appallingly bad!

Page 2 of 2 FirstFirst 12
Please reply to this thread with any new information or opinions.

Similar Threads

  1. Market Data Retrieval
    By Grefcon901 in forum Access
    Replies: 16
    Last Post: 04-07-2016, 01:59 PM
  2. Replies: 2
    Last Post: 08-11-2015, 01:47 AM
  3. feedback on query written
    By Compufreak in forum Access
    Replies: 1
    Last Post: 08-29-2012, 06:16 PM
  4. Replies: 7
    Last Post: 06-16-2010, 09:19 AM
  5. Replies: 2
    Last Post: 10-01-2009, 03:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums