Subject | Re: Unions |
---|---|
Author | Adam |
Post date | 2005-02-21T02:53:40Z |
Do you mean
Select xxxx from yyyy
Union
Select wwww from zzzz
I presume that it is what you meant because there is no point
otherwise. Both sections of the query can be optimised separately, so
it should be fine.
Obviously though if you are doing a table scan on the same table
twice, such as
select ID
from Employee
where Name = 'Chad'
Union
select ID
from Employee
where Name = 'Adam'
would be a bad idea if there is no index on Name.
Adam
--- In firebird-support@yahoogroups.com, "Chad Z. Hower aka Kudzu"
<chad-jm@h...> wrote:
Select xxxx from yyyy
Union
Select wwww from zzzz
I presume that it is what you meant because there is no point
otherwise. Both sections of the query can be optimised separately, so
it should be fine.
Obviously though if you are doing a table scan on the same table
twice, such as
select ID
from Employee
where Name = 'Chad'
Union
select ID
from Employee
where Name = 'Adam'
would be a bad idea if there is no index on Name.
Adam
--- In firebird-support@yahoogroups.com, "Chad Z. Hower aka Kudzu"
<chad-jm@h...> wrote:
> Using a union as insystem:
>
> Select xxxx from yyyy
> Union
> Select xxxx from yyyy
>
> Will this severly negatively impact performance?
>
> --
> Chad Z. Hower aka Kudzu
> "Programming is an art form that fights back"
>
> Still doing your website by hand? Get a free content management
> http://www.atozed.com/iws/