select distinct 99, 31, b.school_id, a.provider_id, a.student_id, '2007', lpad('01',2,'0'), '0' from studprovider a, student b, school c where a.student_id = b.student_id and b.school_id = c.school_id and a.provider_id = 527 and b.t_districtid = 31 and b.status = '1';When I run Explain Plan in database A, there is a full table scan on student. But when I run the explain on database B I get no full table scan, which is what I want. Why the difference in optimizers? Do the number of data rows in the student table make the difference?
Dig Deeper on Oracle and SQL
Related Q&A from Phillip Bracken
A user complains that every time he tries to access a table (select only), it takes more than two hours to get the results. There are no DML ... Continue Reading
I have a table with 1.5 million records that needs to have a column updated based on a correlated subselect. This update is currently sitting at four... Continue Reading
I have always used TKPROF to do SQL tuning in previous versions of Oracle (7,8 and 9). Can I still use TKPROF in Oracle 10g R2? Continue Reading
Have a question for an expert?
Please add a title for your question
Get answers from a TechTarget expert on whatever's puzzling you.