oracle sql query brings the result for a long time
I have written a query in oracle sql as follows. But the sql query brings the result for a long time. For example, when searching for a customer, the result comes in 4 minutes. Please help me to optimize this sql query.
I tried several ways to solve the problem, but I couldn’t get any result.
First, I ran the sql script part by part. Some parts took a lot of time. However, I did not know how to optimize those parts. As a second way, I wanted to find out what made the sql script weak to bring the result, using the v$sql_monitor table, but I could not come to a conclusion. It is interesting to me that this logic can be written in a simpler and faster way while keeping the same logic. The time given to me by my boss is over. Please help me.