Subject | Re: [firebird-support] Re: The First to select |
---|---|
Author | Woody |
Post date | 2006-02-13T22:26:54Z |
From: "Ann W. Harrison" <aharrison@...>
In what way is
select 1
from rdb$database
where exists (select 1
from <table>
where <field> is NULL)
any better than just
select 1 from <table> where <field> is NULL
?
Does selecting 1 from rdb$database cause the fb engine to shortcut the
select as soon as it finds 1 record or does the scan happen in the same way
for both?
Woody (TMW)
>Ann,
> A slightly more conventional version would be
>
> select 1
> from rdb$database
> where exists (select 1
> from <table>
> where <field> is NULL)
>
>
> Either is exactly a full table scan if the field is never null, but
> less than that if the field can be null.
In what way is
select 1
from rdb$database
where exists (select 1
from <table>
where <field> is NULL)
any better than just
select 1 from <table> where <field> is NULL
?
Does selecting 1 from rdb$database cause the fb engine to shortcut the
select as soon as it finds 1 record or does the scan happen in the same way
for both?
Woody (TMW)