Subject | Re: [firebird-support] Left Join vs Not Exists |
---|---|
Author | Alexandre Benson Smith |
Post date | 2005-10-12T18:01:26Z |
Rick Debay wrote:
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
>I know of two ways to get records from set A that don't exist in set B.I think you should try the both and look for the better...
>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
>
>
>
>
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