Subject | Re: Using view in IBO |
---|---|
Author | Svein Erling |
Post date | 2003-12-12T08:47:44Z |
> I could like to know if which is a better solution. Will there beIf this particular query causes you problems, then you may change to
> a big difference in performance if I use view in Tib_query instead
> of a normal sql select.
>
> My sql is this:
>
> select * from "invoice"
> where "Type" in (select ID from "expensetype")
>
> If the view could be a better solution ... the view could derived
> from the sql above. As of now I do things without using view, as
> long as the sql is simple. What is the sql is compose of a lot of
> left joins what is the better solution then.
select * from "invoice"
where exists(
select * from "expencetype"
where "invoice"."Type" = "expensetype".ID)
I think Firebird 1.5 is better than previous versions when doing IN
<subselect>, but EXISTS is definitely a better choice for earlier
versions.
Set