What is better: An explicit distributed query or a distributed one
Posted in 2004
Topics: General Discussion
This is a multi-part message in MIME format.
--------------060704010603070505030909
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit
Hi, all
Does anyone know if there is som kind of penalty or on the contrary some
gain in using a view instead of a distributed query?
I explain myself: <large>
Let's say I have two machines omicron and omega, both connected with
informix instances up and running.
Machine omega has database bdsiges with table gio_movdet.
Machine omicron has database basdat with table cocco.
I want to do a query like this on machine omega:
select d.codfue, d.numdoc, d.cencos, cconom
from gio_movdet d, basdat@omicron:cocco c
where d.cencos = c.ccocod
and d.cencos is not null;
That works as expected with no problem.
Let's say we create a view on machine omega database bdsiges like this:
crete view cocco_basdat as
select *
from basdat@omicron:cocco
So I can rewrite the previous query like this one:
select d.codfue, d.numdoc, d.cencos, cconom
from gio_movdet d, cocco_basdat c
where d.cencos = c.ccocod
and d.cencos is not null;
That works as expected with no problem and returns exactly the same
result set as the first query does.
</large>
So which one of the two previuos querys "performs better" and why?
... My boss ask me this, and I didn't know what to answer... I just
supposed a distributed query is sligtly better that using a view but I'm
not certain for sure.
Any help would be greatly appreciated
Chucho!
--
Atte,
Jesus Antonio Santos Giraldo
-----------------------------------
jeansagi@myrealbox.com
jeansagi@netscape.net
--------------060704010603070505030909
Content-Type: text/x-vcard; charset=utf8;
name="jeansagi.vcf"
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment;
filename="jeansagi.vcf"
begin:vcard
fn:Jesus Antonio Santos Giraldo
n:Santos Giraldo;Jesus Antonio
org;quoted-printable:Fundacion Clinica Valle del Lili;Inform=C3=A1tica
adr:;;Cra 76A # 8 - 34;Cali;Valle del Cauca;Valle;Colombia
email;internet:jeansagi@myrealbox.com
title:Analista de sistemas
tel;work:+57(2)3317474 +57(2)3319090 Ext. 3130 o 3102
tel;fax:+57(2)3316728
tel;home:+57(2)3396928
tel;cell:+57(315)5264177
x-mozilla-html:FALSE
url:http://www.fcvl.org
version:2.1
end:vcard
--------------060704010603070505030909--
sending to informix-list
shouldn't be any difference.
"Jesus Antonio Santos Giraldo" <jeansagi@myrealbox.com> wrote in message
news:c12u9a$1lu$1@terabinaries.xmission.com...
>
> This is a multi-part message in MIME format.
> --------------060704010603070505030909
> Content-Type: text/plain; charset=us-ascii; format=flowed
> Content-Transfer-Encoding: 7bit
>
>
> Hi, all
>
> Does anyone know if there is som kind of penalty or on the contrary some
> gain in using a view instead of a distributed query?
>
>
> I explain myself: <large>
>
> Let's say I have two machines omicron and omega, both connected with
> informix instances up and running.
>
> Machine omega has database bdsiges with table gio_movdet.
> Machine omicron has database basdat with table cocco.
>
> I want to do a query like this on machine omega:
>
> select d.codfue, d.numdoc, d.cencos, cconom
> from gio_movdet d, basdat@omicron:cocco c
> where d.cencos = c.ccocod
> and d.cencos is not null> ;
>
> That works as expected with no problem.
>
> Let's say we create a view on machine omega database bdsiges like this:
>
> crete view cocco_basdat as
> select *
> from basdat@omicron:cocco>
> So I can rewrite the previous query like this one:
>
> select d.codfue, d.numdoc, d.cencos, cconom
> from gio_movdet d, cocco_basdat c
> where d.cencos = c.ccocod
> and d.cencos is not null> ;
>
> That works as expected with no problem and returns exactly the same
> result set as the first query does.
>
> </large>
>
> So which one of the two previuos querys "performs better" and why?
>
> ... My boss ask me this, and I didn't know what to answer... I just
> supposed a distributed query is sligtly better that using a view but I'm
> not certain for sure.
>
>
> Any help would be greatly appreciated
>
>
>
> Chucho!
> --
>
> Atte,
>
> Jesus Antonio Santos Giraldo
> -----------------------------------
> jeansagi@myrealbox.com
> jeansagi@netscape.net
>
> --------------060704010603070505030909
> Content-Type: text/x-vcard; charset=utf8;
> name="jeansagi.vcf"
> Content-Transfer-Encoding: 7bit
> Content-Disposition: attachment;
> filename="jeansagi.vcf"
>
> begin:vcard
> fn:Jesus Antonio Santos Giraldo
> n:Santos Giraldo;Jesus Antonio
> org;quoted-printable:Fundacion Clinica Valle del Lili;Inform=C3=A1tica
> adr:;;Cra 76A # 8 - 34;Cali;Valle del Cauca;Valle;Colombia
> email;internet:jeansagi@myrealbox.com
> title:Analista de sistemas
> tel;work:+57(2)3317474 +57(2)3319090 Ext. 3130 o 3102
> tel;fax:+57(2)3316728
> tel;home:+57(2)3396928
> tel;cell:+57(315)5264177
> x-mozilla-html:FALSE
> url:http://www.fcvl.org
> version:2.1
> end:vcard
>
>
> --------------060704010603070505030909--
> sending to informix-list