简体   繁体   中英

Speed up Oracle SQL Developer query in large Oracle Database

I am querying an Oracle DB using Oracle SQL Developer. The query is running slowly. I am away that using Distinct is likely slowing me down. But I haven't been able to produce unique rows without the Distinct call. The database contains no duplicate rows. So, it is likely that I malformed this query. How do I speed up this query? The query is as follows:

SELECT DISTINCT 
    view1.table1.col1, 
    view1.table2.col2, 
    view1.table2.col3, 
    view1.table1.col4, 
    view1.table3.col5, 
    view1.table4.col6 
FROM 
    view1.table1, 
    view1.table3, 
    view1.table2, 
    view1.table4
WHERE 
    table1.col1 = table2.col7
AND
    table1.col4 = table3.col8
AND
    table1.col4 >= '19-DEC-20'
AND 
    table4.col9 = table3.col10 ``` 
table1:  INDEX(col4, col1)
table3:  INDEX(col8, col5, col10)
table2:  INDEX(col7, col2, col3)
table4:  INDEX(col9, col6)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM