Re: [firebird-support] Not Exists cost

2012-04-03 Thread Marc Gilels
t: RE: [firebird-support] Not Exists cost > If B_TABLE.VALUE2 never contains 'X' and half of A_TABLE.VALUE1 are 'Y' > what would be the cost of executing this statement? A_TABLE.VALUE1 is > indexed and B_TABLE.VALUE2 does not have an index. > >

RE: [firebird-support] Not Exists cost

2012-04-03 Thread Rick Debay
To: firebird-support@yahoogroups.com Subject: Re: [firebird-support] Not Exists cost >> SELECT * >> FROM A_TABLE at >> WHERE >> at.VALUE1 = 'Y' AND >> NOT EXISTS ( >>SELECT 1 >>FROM B_TABLE bt >>WHERE bt.VALUE2 = 'X'); &

RE: [firebird-support] Not Exists cost

2012-04-03 Thread Rick Debay
: Monday, April 02, 2012 5:13 PM To: firebird-support@yahoogroups.com Subject: RE: [firebird-support] Not Exists cost > If B_TABLE.VALUE2 never contains 'X' and half of A_TABLE.VALUE1 are 'Y' > what would be the cost of executing this statement? A_TABLE.VALUE1 is > in

Re: [firebird-support] Not Exists cost

2012-04-03 Thread Tomasz Tyrakowski
>> SELECT * >> FROM A_TABLE at >> WHERE >> at.VALUE1 = 'Y' AND >> NOT EXISTS ( >>SELECT 1 >>FROM B_TABLE bt >>WHERE bt.VALUE2 = 'X'); > > The query PLAN would tell you for certain, but I would expect the answer to > be: > half of A_TABLE rows times all of B_TABLE rows. If there'

RE: [firebird-support] Not Exists cost

2012-04-02 Thread Leyne, Sean
> If B_TABLE.VALUE2 never contains 'X' and half of A_TABLE.VALUE1 are 'Y' > 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 stateme

[firebird-support] Not Exists cost

2012-04-02 Thread Rick Debay
If B_TABLE.VALUE2 never contains 'X' and half of A_TABLE.VALUE1 are 'Y' 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 evalua