Is querying over a view slower than executing SQL directly?

后端 未结 2 1974
孤城傲影
孤城傲影 2021-01-17 13:11

Scenario:

I have 3 tables needing to be joined together, a where clause to limit the result set, and only a few columns from each table being selected. Simple. Howev

2条回答
  •  旧时难觅i
    2021-01-17 13:45

    In Oracle, the performance is the same. A view is really a named sql statement. But fancier.

    When you start nesting views, and joining views with other table or views, things get complicated real quick. If Oracle can't push your filters down the view to the table, it often has to materialize (build a temp table of) parts of the query, and this is when you get the bad performance.

提交回复
热议问题