Subject | Re: [firebird-support] Not Exists cost |
---|---|
Author | Marc Gilels |
Post date | 2012-04-03T14:52:19Z |
I don't know if Tom told you but your suggestion to see the real error code led my programmer to release a
new version THAT WORKKED!!......I can not thank you enough.
-----Original Message-----
From: Leyne, Sean <Sean@...>
To: firebird-support <firebird-support@yahoogroups.com>
Sent: Mon, Apr 2, 2012 5:12 pm
Subject: RE: [firebird-support] Not Exists cost
half of A_TABLE rows times all of B_TABLE rows.
Sean
[Non-text portions of this message have been removed]
new version THAT WORKKED!!......I can not thank you enough.
-----Original Message-----
From: Leyne, Sean <Sean@...>
To: firebird-support <firebird-support@yahoogroups.com>
Sent: Mon, Apr 2, 2012 5:12 pm
Subject: RE: [firebird-support] Not Exists cost
> If B_TABLE.VALUE2 never contains 'X' and half of A_TABLE.VALUE1 are 'Y'The query PLAN would tell you for certain, but I would expect the answer to be:
> what would be the cost of executing this statement? A_TABLE.VALUE1 is
> indexed and B_TABLE.VALUE2 does not have an index.
>
> Would it be half of A_TABLE rows times all of B_TABLE rows? Or would the
> Not Exists statement be evaluated for every row in A_TABLE making it
> A_TABLE rows times B_TABLE rows?
>
> SELECT *
> FROM A_TABLE at
> WHERE
> at.VALUE1 = 'Y' AND
> NOT EXISTS (
> SELECT 1
> FROM B_TABLE bt
> WHERE bt.VALUE2 = 'X');
half of A_TABLE rows times all of B_TABLE rows.
Sean
[Non-text portions of this message have been removed]