Page 1 of 1

Accessing few records from a bulk of lakhs of records from a

Posted: Thu Mar 13, 2008 6:39 am
by G SHIVARANJANI
Hi,

could any one help me understand ,what should be taken care while accessing few records from a bulk of lakhs of records from a table using ODBC stage.

As when i tried to SELECT on a table with lots of records in it
the view data takes lots of time making the job get hanged.

Please suggest.
Also once gave timed out error.

Accessing few records from a bulk of lakhs of records

Posted: Thu Mar 13, 2008 6:51 am
by consulting
use head stage or tail stage

Posted: Thu Mar 13, 2008 7:30 am
by DSguru2B
Dont hit view data, if you know that your job is going to take a lot of time retrieving the results. "The job hangs" is nothing but a mirage and in reality, its struggling to select the records for your display.
Instead, run your job. This happens especially when you have custom sql with group by's and joins where the keys are not indexed are are just a part of a composite indexed key.

Posted: Thu Mar 13, 2008 4:52 pm
by ray.wurlod
Your job will experience the same delay as View Data while the database is assembling the result set. During this time the stage status (as shown in Monitor) will be "Starting".

Posted: Thu Mar 13, 2008 8:26 pm
by G SHIVARANJANI
Hi,

The query i am using is

SELECT Col1 from Table1 where ADD_MONTHS(Col2,6) <= SYSDATE ."
Where Col2 can be null for mannny of the records,

This query is taking lots of time...Where as

"Select Col1 from table1" takes lesser time for view data however...

this query reads alll the records from the table along with the one which are not required for processing.

ray.wurlod wrote:Your job will experience the same delay as View Data while the database is assembling the result set. During this time the stage status (as shown in Monitor) will be "Starting". ...

Posted: Thu Mar 13, 2008 8:40 pm
by chulett
Nature of the beast. Your 'lesser time' example can return records right away because it selects all records. The first example needs to filter the records you want from the same full scan of the table.

Your use of a function against Col2 in the filter means any index over Col2 cannot be used.