Subject | Re: [firebird-support] Re: Is "EXISTS()" cheap? |
---|---|
Author | Bambang P |
Post date | 2005-09-16T14:25:30Z |
On Friday, September 16, 2005, 7:03:41 PM, Ali Gökçen wrote:
DEND is fields. Indexes on DSTART and DEND are available.
I am rephrasing my example with your suggestion:
if (exists(select 1 from HOLIDAYS where where :ADate between DSTART
and DEND)) then begin
....
The question remains:
Does the select statement step through all records which meet the
condition?
or
Does it return immediately after the first occurance of the
condition?
Thanks anyway.
--
Bambang P.
I want to move to Theory...Everything works in Theory
> --- In firebird-support@yahoogroups.com, Bambang P <bpranoto@g...>Sorry, I was wrong in my example. ADate is a variable while DSTART and
> wrote:
>> In this stored procedure statement:
>>
>> if (exists(select 1 from HOLIDAYS where ADate>=DSTART and
> AData<=DEND))
>> then begin
>> .....
>> end
>>
>> Question:
>>
>> Does the select statement step through all records which meet the
> condition
>> or does it return immediately after the first occurance of the
> condition?
> Hi,
> it is not free but cheapest, if there is an index on ADate field.
> ... where ADate between DSTART and DEND ..
> isn't more clear?
DEND is fields. Indexes on DSTART and DEND are available.
I am rephrasing my example with your suggestion:
if (exists(select 1 from HOLIDAYS where where :ADate between DSTART
and DEND)) then begin
....
The question remains:
Does the select statement step through all records which meet the
condition?
or
Does it return immediately after the first occurance of the
condition?
Thanks anyway.
--
Bambang P.
I want to move to Theory...Everything works in Theory