Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

6 million + records, query takes more than 50 min to execute.

710658Jul 13 2009 — edited Jul 13 2009
Hi

I am trying to get records from a table which has more than 6 million of records.

The value set of the particular col IND can be
NULL
'0'
'1'
and other value like A B '6'

The data type of IND is varchar.

I want all the records where the value is other than NULL, 0 and 1

I tried this simple query

SELECT ID, IND
FROM tablename
WHERE
IND IS NOT NULL
AND IND <> '0'
AND IND <> '1'

Now this query is taking more than 30-40 min. Is this a way I can speed up this query. Also I can't index on the column.

any suggestions ?
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 10 2009
Added on Jul 13 2009
5 comments
1,081 views