J
janiotjoeawie via AccessMonster.com
I have a form with tabs. On one of my tabs I have a subform. The data of this
subform is pulled trough a query. This specific query is bases on 1 query and
2 tables. It takes about 6 seconds to run the query wich is very slow if you
have to browse trough your records.
The query looks like:
SELECT qry_cursist_programme.CURSISTID, qry_cursist_programme.JAAR,
qry_cursist_programme.PROGRAMMAID, CURSIST_FLIGHTDETAILS.DEPARTURE_CITY,
CURSIST_ADRESSEN_VIEW.PLAATS, IIf(IsNull([departure_city]),[plaats],
[departure_city]) AS Departure, CURSIST_FLIGHTDETAILS.FLIGHTNUMBER
FROM
(qry_cursist_programme LEFT JOIN CURSIST_FLIGHTDETAILS
ON
(qry_cursist_programme.JAAR = CURSIST_FLIGHTDETAILS.YEAR)
AND
(qry_cursist_programme.PROGRAMMAID = CURSIST_FLIGHTDETAILS.PROGRAMME_ID)
AND
(qry_cursist_programme.CURSISTID = CURSIST_FLIGHTDETAILS.CURSIST_ID))
INNER JOIN
CURSIST_ADRESSEN_VIEW
ON
qry_cursist_programme.CURSISTID = CURSIST_ADRESSEN_VIEW.CURSISTID;
It pulls about 28000 records.
The query qry_cursist_programma on which it is based is the follow and has no
performance problem:
SELECT DISTINCT CURSUSSEN_VIEW.JAAR, CURSUSSEN_VIEW.PROGRAMMAID,
CURSIST_VOLGT_CURSUS_VIEW.CURSISTID
FROM
CURSIST_VOLGT_CURSUS_VIEW INNER JOIN CURSUSSEN_VIEW
ON
(CURSIST_VOLGT_CURSUS_VIEW.CURSUSID = CURSUSSEN_VIEW.CURSUSID) AND
(CURSIST_VOLGT_CURSUS_VIEW.JAAR = CURSUSSEN_VIEW.JAAR);
Why is the first query so slow. Is is not the iif case because if I ommit the
statment it is still to slow.
Regards.
subform is pulled trough a query. This specific query is bases on 1 query and
2 tables. It takes about 6 seconds to run the query wich is very slow if you
have to browse trough your records.
The query looks like:
SELECT qry_cursist_programme.CURSISTID, qry_cursist_programme.JAAR,
qry_cursist_programme.PROGRAMMAID, CURSIST_FLIGHTDETAILS.DEPARTURE_CITY,
CURSIST_ADRESSEN_VIEW.PLAATS, IIf(IsNull([departure_city]),[plaats],
[departure_city]) AS Departure, CURSIST_FLIGHTDETAILS.FLIGHTNUMBER
FROM
(qry_cursist_programme LEFT JOIN CURSIST_FLIGHTDETAILS
ON
(qry_cursist_programme.JAAR = CURSIST_FLIGHTDETAILS.YEAR)
AND
(qry_cursist_programme.PROGRAMMAID = CURSIST_FLIGHTDETAILS.PROGRAMME_ID)
AND
(qry_cursist_programme.CURSISTID = CURSIST_FLIGHTDETAILS.CURSIST_ID))
INNER JOIN
CURSIST_ADRESSEN_VIEW
ON
qry_cursist_programme.CURSISTID = CURSIST_ADRESSEN_VIEW.CURSISTID;
It pulls about 28000 records.
The query qry_cursist_programma on which it is based is the follow and has no
performance problem:
SELECT DISTINCT CURSUSSEN_VIEW.JAAR, CURSUSSEN_VIEW.PROGRAMMAID,
CURSIST_VOLGT_CURSUS_VIEW.CURSISTID
FROM
CURSIST_VOLGT_CURSUS_VIEW INNER JOIN CURSUSSEN_VIEW
ON
(CURSIST_VOLGT_CURSUS_VIEW.CURSUSID = CURSUSSEN_VIEW.CURSUSID) AND
(CURSIST_VOLGT_CURSUS_VIEW.JAAR = CURSUSSEN_VIEW.JAAR);
Why is the first query so slow. Is is not the iif case because if I ommit the
statment it is still to slow.
Regards.