markhan
Programmer
- Mar 9, 2011
- 11
Hi all!
Well lets see if someone could help me a little bit and give me some guidelines about what can i do...
Database: Access 2000
Rows: 1.8Millions
LD = is a Date
There are no relationships.
The database is like this:
SN GN VN LD LV LQ LA
-----------------------------------------------
E 1M AA X 0 0
E 1M AB X - 23712
T 10S BB Y 0 20400
E 1M AB Y 0 1
Index:
GN GN Ascending
LD LD Ascending
SN SN Ascending
VN SN Ascending
SQL:
Where %s is a String that is going to change with the DB values
example:
VN has many different values, SN and GN only has a few different values, LD is a date so has many different and duplicates.
My problem is that This Query sometimes needs like 15 secs to finish it and thats not viable for the program. I need it faster
What i can't really understand is that sometimes the query for the same amount of data needs like 15 secs and other times 1 or less. :/
What should i do? :S
Thanks in advance,
kind regards.
Well lets see if someone could help me a little bit and give me some guidelines about what can i do...
Database: Access 2000
Rows: 1.8Millions
LD = is a Date
There are no relationships.
The database is like this:
SN GN VN LD LV LQ LA
-----------------------------------------------
E 1M AA X 0 0
E 1M AB X - 23712
T 10S BB Y 0 20400
E 1M AB Y 0 1
Index:
GN GN Ascending
LD LD Ascending
SN SN Ascending
VN SN Ascending
SQL:
Code:
SELECT SN, GN, VN, LD, LQ
FROM L
WHERE VN='%s' AND SN='%s'AND GN='%s'
AND LQ >= 20480 AND (De < #%s#) ORDER BY LD
example:
Code:
Select SN,GN,VN,LD,LQ
FROM L
WHERE VN = 'AA' AND SN = 'E'
AND GN = '1M' AND LQ >= '20480' AND DE < 'Y'
ORDER BY LD
My problem is that This Query sometimes needs like 15 secs to finish it and thats not viable for the program. I need it faster
What i can't really understand is that sometimes the query for the same amount of data needs like 15 secs and other times 1 or less. :/
What should i do? :S
Thanks in advance,
kind regards.