Subject | index |
---|---|
Author | justsome.rm |
Post date | 2010-11-14T19:57:05Z |
Hi
i have the next table
CREATE TABLE DATA (
ID INTEGER NOT NULL,
DATADATE DOUBLE PRECISION,
DATATIME DOUBLE PRECISION,
MEASUREVALUE DOUBLE PRECISION,
SENSORID INTEGER,
VALUEINDEX INTEGER,
CHANNELID INTEGER
);
in the mean time i have 8,5 miljon records in it
this is a query i use
Select
sensorid,
datadate,
sum(measurevalue)
from data
where SensorId=153 and
dataDate>=39125 and
DataDate<=40524 and
ValueIndex=1
group by
datadate,
sensorid
only opening takes 1,5 second. I used many indexes but none of them did get it faster
ValueIndex can only be 1 or 2 or null
SensorId 290 different sensor id's
date 1976 diferent dates
which index should i use ?
After running the query i use a while loop to get the values in memory this takes also 2,5 second with ibx components what is the beste way to do this are there faster components ?
i have the next table
CREATE TABLE DATA (
ID INTEGER NOT NULL,
DATADATE DOUBLE PRECISION,
DATATIME DOUBLE PRECISION,
MEASUREVALUE DOUBLE PRECISION,
SENSORID INTEGER,
VALUEINDEX INTEGER,
CHANNELID INTEGER
);
in the mean time i have 8,5 miljon records in it
this is a query i use
Select
sensorid,
datadate,
sum(measurevalue)
from data
where SensorId=153 and
dataDate>=39125 and
DataDate<=40524 and
ValueIndex=1
group by
datadate,
sensorid
only opening takes 1,5 second. I used many indexes but none of them did get it faster
ValueIndex can only be 1 or 2 or null
SensorId 290 different sensor id's
date 1976 diferent dates
which index should i use ?
After running the query i use a while loop to get the values in memory this takes also 2,5 second with ibx components what is the beste way to do this are there faster components ?