Running Queries from OraDeveloper for VS2k8
Posted: Fri 10 Apr 2009 15:18
I was trying to run a very simple query from the SQL Window within the VS 2k8 IDE:
select A.indiv_id
FROM CNSMR_SUBSC_OPT A,
REF_SUBSC_CD b,
CPGN_PROMO_HIST C,
CNSMR_INDIV_ATTRIB d
WHERE
A.subsc_cd = b.subsc_cd
AND A.indiv_id = C.indiv_id (+)
AND A.indiv_id = d.indiv_id (+)
AND rownum < 5
... and realized It was taking forever... so I went asked the Oracle guys about this... They've ran the same query using TOAD and the result came back in a flash...
... I wasn't really happy with the idea of switching back to TOAD, so I asked them to run a profile analysis on the query and found out that after my query is sent to the database, the following query is also sent:
SELECT count(*) AS record_count
FROM (SELECT a.indiv_id
FROM cnsmr_subsc_opt a, ref_subsc_cd b, cpgn_promo_hist c,
cnsmr_indiv_attrib d
WHERE a.subsc_cd = b.subsc_cd
AND a.indiv_id = c.indiv_id (+)
AND a.indiv_id = d.indiv_id (+)
AND rownum < 5) record_count_table
... and since we have a couple of huge tables out there... well, the query is taking forever...
... I'm not exactly sure what we can do here... Is there a way we can turn off the row count? or a way to have the row count calculated on the client instead of on the server?[size=9][/size]
select A.indiv_id
FROM CNSMR_SUBSC_OPT A,
REF_SUBSC_CD b,
CPGN_PROMO_HIST C,
CNSMR_INDIV_ATTRIB d
WHERE
A.subsc_cd = b.subsc_cd
AND A.indiv_id = C.indiv_id (+)
AND A.indiv_id = d.indiv_id (+)
AND rownum < 5
... and realized It was taking forever... so I went asked the Oracle guys about this... They've ran the same query using TOAD and the result came back in a flash...
... I wasn't really happy with the idea of switching back to TOAD, so I asked them to run a profile analysis on the query and found out that after my query is sent to the database, the following query is also sent:
SELECT count(*) AS record_count
FROM (SELECT a.indiv_id
FROM cnsmr_subsc_opt a, ref_subsc_cd b, cpgn_promo_hist c,
cnsmr_indiv_attrib d
WHERE a.subsc_cd = b.subsc_cd
AND a.indiv_id = c.indiv_id (+)
AND a.indiv_id = d.indiv_id (+)
AND rownum < 5) record_count_table
... and since we have a couple of huge tables out there... well, the query is taking forever...
... I'm not exactly sure what we can do here... Is there a way we can turn off the row count? or a way to have the row count calculated on the client instead of on the server?[size=9][/size]