Hi.
I have an issue with my Access project.
I have rather big tables of data (about 11 000 rows).
These tables are historical product quotations, so they are very simple :
- MyDate (PrimaryKey)
- Quote
I do some calculations on these data:
- I calculate the 10-days Average, using a subquery.
- I calculate the 10-days StDev, using a subquery.
- I use the query1 to gather all the infos ( MyDate / Quote / 10-days
average/ 10-days StDev)
- I use a form to open a chart which plots the query1.
However, when I open the chart, it takes more than 10 minutes to show the
results !
As I have quite a good Notebook (Sony 1.7Mhz, 1.25Go RAM...), I think there
is an issue in my query optimisation.
What do you think?
My queries are based on this code:
qry1_Average10:
SELECT a.Mydate, a.quote, Avg(b.quote) AS Average10
FROM Mytable AS a, Mytable AS b
WHERE(b.[MyDate]>[a].[MyDate]-10 And b.[MyDate]<=[a].[MyDate])
GROUP BY a.[MyDate],
ORDER BY a.[MyDate];
qry1_StdDev10:
SELECT a.Mydate, a.quote, StDev(b.quote) AS StdDev10
FROM Mytable AS a, Mytable AS b
WHERE(b.[MyDate]>=[a].[MyDate]-14 And b.[MyDate]<[a].[MyDate])
GROUP BY a.[MyDate],
ORDER BY a.[MyDate];
And I just ask for the fields MyDate and Quote from "Mytable" and StDev10 and
Average10 from the subqueries.
How could I make it work much faster?
Regards,
Laurent
--
Message posted via AccessMonster.c om
http://www.accessmonster.com/Uwe/For...ccess/200609/1