Hi!!!
I have this query:
SELECT DISTINCT a.num_cell as phone,
a.cod_client as codclient,
a.cod_acct as acct,
a.num_contract as ncontract,
b.nam_client||' '||b.nom_lastname AS CName,
DECODE (a.tip_plantarif, 'I', 'Individual', 'C', 'Corp', 'H', 'Holding') AS CType,
a.cod_situation as csituation,
a.cod_vendor as nvendor,
a.date1 as date1,
a.date2 as date2 ,
a.date3 as date3,
a.date4 as date4,
a.esn as esn,
a.num_seriehex as hex
FROM GA_ABOCEL a,
GE_CLIENTS b
WHERE b.cod_client = a.cod_client
The problem I'm having is that it returns aprox 300,000 records (which I need to show the user), and it's taking between 35 seconds and 2 minutes to return the rows.
But this only happens when I incorporate the query into my VB app. If I test it anywhere else, it takes about 15 seconds to return the rows. But in VB it hangs the application.
Is there a way to optimize this query, so that it runs just as fast in VB?
Thanks in advance.
Nunina
P. S. - By the way, the primary key is a.cod_client. Thanks!
I have this query:
SELECT DISTINCT a.num_cell as phone,
a.cod_client as codclient,
a.cod_acct as acct,
a.num_contract as ncontract,
b.nam_client||' '||b.nom_lastname AS CName,
DECODE (a.tip_plantarif, 'I', 'Individual', 'C', 'Corp', 'H', 'Holding') AS CType,
a.cod_situation as csituation,
a.cod_vendor as nvendor,
a.date1 as date1,
a.date2 as date2 ,
a.date3 as date3,
a.date4 as date4,
a.esn as esn,
a.num_seriehex as hex
FROM GA_ABOCEL a,
GE_CLIENTS b
WHERE b.cod_client = a.cod_client
The problem I'm having is that it returns aprox 300,000 records (which I need to show the user), and it's taking between 35 seconds and 2 minutes to return the rows.
But this only happens when I incorporate the query into my VB app. If I test it anywhere else, it takes about 15 seconds to return the rows. But in VB it hangs the application.
Is there a way to optimize this query, so that it runs just as fast in VB?
Thanks in advance.
Nunina
P. S. - By the way, the primary key is a.cod_client. Thanks!