When we updated our ODAC to build 9.2.7, we started noticing some screens taking quite a bit longer to open than we previously experienced.
Using dbMonitor, we started seeing where the queries run against the detail tables started having OR ( (DTLFld IS NULL ) AND ( :MSTFld IS NULL ) ) add for each of the linked fields to the master table. This is causing full table scans on huge tables. Here is are some examples of what we now see running:
SELECT T.*
FROM ORDERHDR T
WHERE ( ( LOADNO = :LOADNO ) OR ( ( LOADNO IS NULL ) AND ( :LOADNO IS NULL ) ) )
ORDER BY ORDERID,SHIPID
SELECT T.*
FROM ORDERHDRPASSTHRUS T
WHERE ( ( ORDERID = :ORDERID ) OR ( ( ORDERID IS NULL ) AND ( :ORDERID IS NULL ) ) ) AND ( ( SHIPID = :SHIPID ) OR ( ( SHIPID IS NULL ) AND ( :SHIPID IS NULL ) ) )
ORDER BY ORDERID,SHIPID
TCustomDADataSet.GetFinalSQL is where this code is added. Can the code be smart enough that if the fields are required fields then do not add the IS NULL portion?
Setting LocalMasterDetail = True does not speed up the process since the where clause is no longer there.
GetFinalSQL causing full table scans with Master/Detail
Re: GetFinalSQL causing full table scans with Master/Detail
Hello,
We will change this behavior in the next version. It will be optional
We will change this behavior in the next version. It will be optional
Re: GetFinalSQL causing full table scans with Master/Detail
Hello Alex,
When will this be available? Can we get a early preview/beta release?
When will this be available? Can we get a early preview/beta release?
Re: GetFinalSQL causing full table scans with Master/Detail
Please send us the license number and an e-mail address to alexp*devart*com where I can send you the beta version, also specify the used IDE
Re: GetFinalSQL causing full table scans with Master/Detail
Alex,
Sent you an email.
Sent you an email.
Re: GetFinalSQL causing full table scans with Master/Detail
The license you have sent has expired in October 2013. Please send a new license number