Greetings, Everyone...
as some of you may remember, there was this c0000005 error in this form.
the c0000005 error has been successfully solved with your help by putting the grid source in a temporary cursor.
now my problem is this:
the SQL command which fills the grid's cursor looks like this:
yeah, I put it together from 4 tables, but that's not the problem...
the main table (emslog) looks like this:
[pre]
Structure for table: N:\NAPLO\WATCHMAN\EMS2101.DBF
Number of data records: 515071
Date of last update: 2021.01.17
Code Page: 1250
Field Field Name Type Width Dec Index Collate Nulls Next Step
1 GEPSZAM Numeric 8 Asc Machine No
2 DATUM Date 8 Asc Machine No
3 IDO Character 12 No
4 UZKOD Numeric 5 No
** Total ** 34
[/pre]
this table by the 2nd half of the month grows to ~515000 records and by the end of the month ~800000 records.
the trouble is the following:
I do two kinds of queries for the users, one by the ATM ID (gepszam N(8) field) or one for specific EMS code (uzkod N(5) field), and I give the filter parameter to the query in the "WHERE &filt" clause.
When I do the query for the "gepszam" field, the query runs in an acceptable ~0.5sec time, which also allows refreshing through a timer for a near-real-time log watching.
But when I do the query for the "uzkod" field (both are numeric fields) the same query would run for some 20 seconds, which prevents the automatic refreshing.
I don't know, what causes the difference between the query times. the table is the same, only the filter field's position (1st vs 4th) differs. can this cause this huge difference in the query time?
as some of you may remember, there was this c0000005 error in this form.
the c0000005 error has been successfully solved with your help by putting the grid source in a temporary cursor.
now my problem is this:
the SQL command which fills the grid's cursor looks like this:
Code:
SELECT emslog.*, tmstcode.uzenet, tmaccode.osztaly, tmaccode.rgb, tmaccode.szkod, ;
gepek.cim_varos, gepek.cim_utca, gepek.ceg ;
FROM (.emsname) emslog ;
LEFT JOIN gepek ON emslog.gepszam=gepek.gepszam ;
LEFT JOIN tmstcode ON emslog.uzkod=tmstcode.uzkod AND gepek.tipus=tmstcode.kodtip2 ;
LEFT JOIN tmaccode ON tmstcode.actcode=tmaccode.uzkod ;
WHERE &filt ;
ORDER BY 2,3 ;
INTO CURSOR emstemp READWRITE
yeah, I put it together from 4 tables, but that's not the problem...
the main table (emslog) looks like this:
[pre]
Structure for table: N:\NAPLO\WATCHMAN\EMS2101.DBF
Number of data records: 515071
Date of last update: 2021.01.17
Code Page: 1250
Field Field Name Type Width Dec Index Collate Nulls Next Step
1 GEPSZAM Numeric 8 Asc Machine No
2 DATUM Date 8 Asc Machine No
3 IDO Character 12 No
4 UZKOD Numeric 5 No
** Total ** 34
[/pre]
this table by the 2nd half of the month grows to ~515000 records and by the end of the month ~800000 records.
the trouble is the following:
I do two kinds of queries for the users, one by the ATM ID (gepszam N(8) field) or one for specific EMS code (uzkod N(5) field), and I give the filter parameter to the query in the "WHERE &filt" clause.
When I do the query for the "gepszam" field, the query runs in an acceptable ~0.5sec time, which also allows refreshing through a timer for a near-real-time log watching.
But when I do the query for the "uzkod" field (both are numeric fields) the same query would run for some 20 seconds, which prevents the automatic refreshing.
I don't know, what causes the difference between the query times. the table is the same, only the filter field's position (1st vs 4th) differs. can this cause this huge difference in the query time?