Subject RE: [firebird-support] Re: Differents results using EXISTS
Author Sasha Matijasic
> >I know he has his answer and this is effectively a closed thread,
> >however I have a related question about it. For these exists clauses,
> >is there a preferred method?
> >
> >1. where exists (select * from some_table where some_where_clause)
>
> Too heavy
>
> >2. where exists (select somefield from some_table where
> >some_where_clause)
>
> Not so heavy, but you're not trying to return a value so why use the
> resources?
>
> >3. where exists (select 1 from some_table where some_where_clause)
>
> Good.
>

Well I guess this thread just brings on more questions, because now I am confused. I always believed those 3 statements are essentially the same because optimizer kicks in and ignores whatever you are trying to select. Am I wrong?

Sasha