How to avoid this very heavy query that slows down the application?

前端 未结 9 635
日久生厌
日久生厌 2021-01-05 18:56

We have a web application running in a production enviroment and at some point the client complained about how slow the application got.

When we checked what was goi

9条回答
  •  说谎
    说谎 (楼主)
    2021-01-05 19:08

    I just wanted to put in the workaround I used to get around this problem. We typically have lots of schemas in our databases and this would take hours to finish in the application we were trying to use which used hibernate because of the large number of objects that it ended up checking (the query itself would execute fast but it just did so many of them).

    What I did is overrode the ALL_OBJECTS view in the schema being connected to so that it only brought back it's own objects and not all objects in the db.

    e.g.

    CREATE OR REPLACE VIEW ALL_OBJECTS AS SELECT USER OWNER, O.* FROM USER_OBJECTS O;

    It's not the greatest solution but for this application there is nothing else that would be using the ALL_OBJECTS view so it works fine and starts up substantially faster.

提交回复
热议问题