Subject Re: [ib-support] Very Slow Query
Author Bill Katelis
try this :

Select Cliente.Nome
From Cliente,Cliente_Mailing Where
(Cliente_Mailing.id_mailing=8)
and Cliente.id_cliente=Cliente_Mailing.id_cliente
union

Select Cliente.Nome
From Cliente,Cliente_Mailing Where
(Cliente_Mailing.id_mailing=9)
and Cliente.id_cliente=Cliente_Mailing.id_cliente
order by 1;


bill

las19682000 wrote:

>Hi, i have about 400,000 records on my table Cliente and about
>400,000 on
>Cliente_Mailing and when i run this query:
>
>Select Cliente.Nome
> From Cliente,Cliente_Mailing Where
> (Cliente_Mailing.id_mailing=9 or Cliente_Mailing.id_mailing=8)
> and Cliente.id_cliente=Cliente_Mailing.id_cliente
> Order by nome
>
>It Takes about 24 minutes
>
>But if i test only Cliente_Mailing.id_mailing=9 like this:
>Select Cliente.Nome
> From Cliente,Cliente_Mailing Where
> (Cliente_Mailing.id_mailing=9)
> and Cliente.id_cliente=Cliente_Mailing.id_cliente
> Order by nome
>
>it takes 1 second
>
>Why and how to speed the top query
>Thanks
>
>
>
>
>To unsubscribe from this group, send an email to:
>ib-support-unsubscribe@egroups.com
>
>
>
>Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>