Should it be possible to link a DA4 master table with a DA3 detail table?
At present it looks like the generated SQL is not correct although the dataset appears correct
When I link a DA3 to a DA3 table or a DA4 to a DA4 table it fetches the details based on the specified mapping (during scrolling through the master)
However when I link a DA3 to a DA4 it fetches the entire child table
This is how I link the tables
DetailTable.MasterSource:=Self.DataSource;
DetailTable.MasterMappingMode:=mmWhere;
DetailTable.MasterFields:=MasterFields;
DetailTable.DetailFields:=DetailFields;
This is the speed and result in code
[MAINTHR][08-03-2022 09:40:10.929][DEBUG(1)]FirmaBes open:0,004660 sec for 3 records
[MAINTHR][08-03-2022 09:40:11.384][DEBUG(1)]FirmaBes.BesDA3 open:0,454927 sec for 1 records master.fbe_primkey:15 master.fbe_bes_primkey:100061084 child.bes_primkey:100061084
[MAINTHR][08-03-2022 09:40:11.410][DEBUG(1)]FirmaBes.BesDA4 open:0,025631 sec for 1 records master.fbe_primkey:15 master.fbe_bes_primkey:100061084 child.bes_primkey:100061084
[MAINTHR][08-03-2022 09:40:11.968][DEBUG(1)]After FirmaBes.Next FirmaBes.BesDA3 child has 1 records master.fbe_primkey:17 master.fbe_bes_primkey:100061058 child.bes_primkey:100061058
[MAINTHR][08-03-2022 09:40:11.968][DEBUG(1)]After FirmaBes.Next: BesDA4 child has 1 records master.fbe_primkey:17 master.fbe_bes_primkey:100061058 child.bes_primkey:100061058
This is correct behaviour, meaning the correct detail record set is attached but the speed with the DA3 child is bad.
It looks like this is because the entire child table is fetched from SQL
DA3 child SQL:SELECT … FROM Bestelling left join leverancier on lev_Primkey = bes_lev_Primkey order by bes_Datum desc
DA4 child SQL:SELECT … FROM Bestelling left join leverancier on lev_Primkey = bes_lev_Primkey
where (Bestelling.bes_Primkey = 100061084)
order by bes_Datum desc
FYI: A scroll of the master (next) fetches the entire DA3 child table again.
This looks like a bug to me or am I missing something.