My understanding has always been that we should not use DDS logicals in SQL statements, because it means the SQL engine has less scope for optimising the access.
Is that still the case?
And what if the logical has Select/Omit rules?
I now need to write a query to pull data from a join of 2 tables. On one of those tables, I want to limit the join to certain types of record. E.g.
TableB already has a logical that uses a Select rule to filter for just the desired type. If I join the physical and have the type filter in the SQL like this, then I now have that type filtering logic in 2 places - once in the DB and once in my program. Or I could join the logical and not need to check type in the SQL like this:
What should I do?
Is that still the case?
And what if the logical has Select/Omit rules?
I now need to write a query to pull data from a join of 2 tables. On one of those tables, I want to limit the join to certain types of record. E.g.
Code:
select * from TableA a left join TableB b on a.key = b.key and b.type = 'S' // This is the record type
Code:
select * from TableA a left join TableB_L1 b // This is the logical that filters for record type s on a.key = b.key
What should I do?
Comment