You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Background why I am doing this.
With the “Global” property in table1, the values from table3 should always be loaded from the main in table2 (there can only ever be one main in table2).
Otherwise if not “Global” read as usual.
I have packed this statement into a view to manipulate the access to table3 in the program. (I didn't want to have to adapt everything in Delphi)
This also works as desired, but a bit slow due to the multiple reads which in my opinion are unnecessary.
Is there a way to make it so that only 314 or 290 reads are made for the example?
If T1. “GLOBAL” is true, for example, you do not actually need to execute the condition if T1. “GLOBAL” is false.
selectT1.IDas T1_ID,
T2.IDas T2_ID,
T3.WERTfrom TABLE1 T1
cross join TABLE2 T2
inner join TABLE3 T3 onT3.T1_ID=T1.ID-- 604 reads
( ( T1."GLOBAL"and
( T3.T2_ID= ( selectT2_TEMP.IDfrom TABLE2 T2_TEMP
whereT2_TEMP.MAIN))) or
( not T1."GLOBAL"and
( T3.T2_ID=T2.ID)))
-- 314 reads
( T3.T2_ID= ( selectT2_TEMP.IDfrom TABLE2 T2_TEMP
whereT2_TEMP.MAIN))
-- 290 reads
( T3.T2_ID=T2.ID)
-- iif() 5264 reads (If at least one of the True or False values in iif is a magic number then it works as I want. Either 314 or 290 reads.)T3.T2_ID= iif( T1."GLOBAL", ( selectT2_TEMP.IDfrom TABLE2 T2_TEMP
whereT2_TEMP.MAIN), T2.ID)
whereT1.ID=111andT2.ID=20
The text was updated successfully, but these errors were encountered:
Background why I am doing this.
With the “Global” property in table1, the values from table3 should always be loaded from the main in table2 (there can only ever be one main in table2).
Otherwise if not “Global” read as usual.
I have packed this statement into a view to manipulate the access to table3 in the program. (I didn't want to have to adapt everything in Delphi)
This also works as desired, but a bit slow due to the multiple reads which in my opinion are unnecessary.
Is there a way to make it so that only 314 or 290 reads are made for the example?
If T1. “GLOBAL” is true, for example, you do not actually need to execute the condition if T1. “GLOBAL” is false.
The text was updated successfully, but these errors were encountered: