I’m using Microsoft Access 2003. One form in my project takes a long time to appear to users.
This is the applicable query:
SELECT DISTINCT tb_KonzeptDaten.DFCC
,tb_KonzeptDaten.OBD_Code AS Konzept_Obd
,tb_bauteile.*
,FehlerCodes_akt_Liste.VAG_Code
,FehlerCodes_akt_Liste.OBD_Code
,FehlerCodes_akt_Liste.F_Klasse_EU
,FehlerCodes_akt_Liste.F_Klasse_US
,FehlerCodes_akt_Liste.CDT AS CdtNr
,FehlerCodes_akt_Liste.Pfad_Bezeichnung
,FehlerCodes_akt_Liste.Fehlerpfad AS PfadName
,FehlerCodes_akt_Liste.Fehlerunterpfad
,tb_bauteile_Tools.Tool AS Tool_
FROM (
(
tb_bauteile LEFT JOIN FehlerCodes_akt_Liste ON tb_bauteile.OBD2_Plaus = FehlerCodes_akt_Liste.ID
) LEFT JOIN tb_bauteile_Tools ON tb_bauteile.Tool = tb_bauteile_Tools.ID
)
LEFT JOIN tb_KonzeptDaten ON FehlerCodes_akt_Liste.Fehlerpfad = tb_KonzeptDaten.DFC;
If I delete DISTINCT and then run the query, the performance will be improved
(from 9 seconds to 2 seconds). In addition, I put an index on the neccessary fields as well.
How can I change my query(maybe without DISTINCT) to improve the performance?
I will suggest get distinct ids and then in column query get your desired columns.
something like this