Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: Indexing Help
Have you run this SQL statement through TKPROF or done an Explain Plan?
Are there indexes on the table? What version of Oracle? What is an
acceptable time for this query to complete?
Too many questions....please help us some more.
Thanks,
Brian
Anon wrote:
>
> I have a table with 2 million rows.
>
> I am doing the following select statement against this table.
>
> SELECT *
> FROM TableA
> WHERE A_ID = '1235586'
> AND DATE_COL1 BETWEEN to_date('01-01-2004','DD-MM-YYYY')
> AND to_date('02-01-2004','DD-MM-YYYY')
> AND ( A_TYPE IN (3, 4, 5)
> OR (A_TYPE = 16 AND A_STATUS = '0')
> )
> AND B_TYPE IN (1, 2)
> AND B_STATUS IN (1, 2)
> AND SUBSTR (C_ID, 1, 2) NOT IN ('XI', 'XO', 'XD')
>
> A_type column is low cardinality (3,4,5,9,2,11,16)
> b_type column too (1,2,3)
> a_status low also (1,0)
> c_id is not, true id column
> A_id same as C_id
> dates_col1 ofcourse is are just date all over the place.
>
> Any help would be greatly appreciated.
-- =================================================================== Brian Peasland dba_at_remove_spam.peasland.com Remove the "remove_spam." from the email address to email me. "I can give it to you cheap, quick, and good. Now pick two out of the three"Received on Thu Dec 18 2003 - 16:50:55 CST