I have a table with about 2million records. Here is the approximate size.
TIME.CDX – 300,000KB
TIME.DBF – 200,000KB
TIME.FPT – 210,000KB
TIME table structure (there are other fields too….)
PROJECT_ID - N(8)
TASK_ID- N(8)
USER_ID C(10)
TIME_HOURS N(8,3)
TASK table structure (there are other fields too….)
PROJECT_ID - N(8)
TASK_ID- N(8)
Relationship: PROJECT -> TASK -> TIME
The code
This code slows things and take about 5minutes in some cases (depends on the number of tasks and time entries)
I am looking for ways to handle this without archiving the table. We still need to access all the entries in real time.
I am open to any suggestions or guidance. Thanks!
TIME.CDX – 300,000KB
TIME.DBF – 200,000KB
TIME.FPT – 210,000KB
TIME table structure (there are other fields too….)
PROJECT_ID - N(8)
TASK_ID- N(8)
USER_ID C(10)
TIME_HOURS N(8,3)
TASK table structure (there are other fields too….)
PROJECT_ID - N(8)
TASK_ID- N(8)
Relationship: PROJECT -> TASK -> TIME
The code
Code:
SELECT PTASK
SCAN WHILE project_id = proj.project_id
SELECT PTIME
Seek Str(ptask.project_id, 8) + Str(ptask.task_id,8)
Sum Nooptimize While project_id = ptask.project_id .And. task_id = ptask.task_id Hours To ltime
ENDSCAN
This code slows things and take about 5minutes in some cases (depends on the number of tasks and time entries)
I am looking for ways to handle this without archiving the table. We still need to access all the entries in real time.
I am open to any suggestions or guidance. Thanks!