J
John Spencer
Applying indexes should not cause a problem. It should significantly speed up
the operation of the query.
I continued to experiment and was able to process a table of a million records
in about 17 minutes. A table of slightly over 400,000 records took roughly 2
minutes 15 seconds to process.
The time will vary depending on how many records how are involved and how many
records are in each group that needs to be processed.
So my advice is add indexes.
Also, I have not tested this over a network using an Access (Jet) database.
So that may also be having an significant effect on your performance.
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
the operation of the query.
I continued to experiment and was able to process a table of a million records
in about 17 minutes. A table of slightly over 400,000 records took roughly 2
minutes 15 seconds to process.
The time will vary depending on how many records how are involved and how many
records are in each group that needs to be processed.
So my advice is add indexes.
Also, I have not tested this over a network using an Access (Jet) database.
So that may also be having an significant effect on your performance.
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
I have replaced my table with a query for one branch and 70 records and
within split of seconds i've got the result...
When i open the limit to 27000 records for one branch it run more than 15
minutes (and i stop the query)
FYI i'm using Access 2003 and my total records is only 400,000.
I havent do the indexing...coz i'm curious whether will there be any major
changes to my data base when i do indexing?
Thanks
John Spencer said:Make sure you have indexes on Branch and LNamt fields.
It could be the volume of records you are processing. Or it could be a bad
query on my part.
You might try an experiment. Create and save a query that returns records for
just one branch and ACNo.
Replace the references to YourTable with references to the query. See if that
runs. If it does then the query is correctly constructed and the problem is
the volume of records, especially if you have not indexed at least branch and
LNamt. Indexing ACNo may also help.
SELECT A.Branch, A.ACNO, A.LNamt
FROM [QueryName] As A LEFT JOIN [QueryName] As B
ON A.Branch = B.Branch
AND A.LNamt > B.LNamt
GROUP BY A.Branch, A.ACNO, A.LNamt
HAVING Count(B.Branch) <= 19
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County
Thanks for your response.
I've tried the query but the query is still running more than 3 hours till
now...
What could be the problem....
:
YOU might TRY the following query. I think it will work
SELECT A.Branch, A.ACNO, A.LNamt
FROM [YourTable] As A LEFT JOIN [YourTable] As B
ON A.Branch = B.Branch
AND A.LNamt > B.LNamt
GROUP BY A.Branch, A.ACNO, A.LNamt
HAVING Count(B.Branch) <= 19
John Spencer
Access MVP 2002-2005, 2007-2008
The Hilltop Institute
University of Maryland Baltimore County