Subject Re: [firebird-support] Left Join vs Not Exists
Author Alexandre Benson Smith
Rick Debay wrote:

>I know of two ways to get records from set A that don't exist in set B.
>The first is to do a left join, and filter where B.nonNullValue is null.
>The other way would be to not do a join, and filter where there are no
>results based on a query similar to the previous join statement.
>
>What are the merits of each approach, from a best practices standpoint
>and from a Firebird specific implementation? Does the appropriate
>choice rest on respective set sizes, and/or the size of their
>intersection?
>
>Using Not Exists has the advantage of explicitly stating your intention,
>but is there implementation specific issues with the target platform
>executing a select for every item in set A? Would this make the Join
>solution better for certain sets?
>
>Rick DeBay
>
>
>
>
I think you should try the both and look for the better...

But in a left join the left table should be scanned entirely since all
records should be presented in any way

I think not exists ans left join will have similar plans

see you !

--
Alexandre Benson Smith
Development
THOR Software e Comercial Ltda
Santo Andre - Sao Paulo - Brazil
www.thorsoftware.com.br