I want to execute the following query and put it on a gridview in my asp.net app
select *
from INDICATORS, places, places_sales
where places_sales.id = places.id
and
INDICATORS.line in (select line from lines)
the lines table has like a 28000 records and INDICATORS like 18000
This query is executed in oracle sql developer in 6 seconds, but in my asp.net application (with oracle dataacess as connector) takes like 20 minutes
Is there a way to optimize my query?
There are a couple of things you can do to speed it up.
Firstly, is there a join between places or places_sales to INDICATORS?
If there is, you shoul add it, you’re probably getting a cartesian.
Now, for the optimization piece, try the following: