Skip to content
Advertisement

Problem using create view and explain plan

I want to test the efficiency of this query using explain plan for.

The query works without the explain plan but when I use it I get this errors:

I used explain plan on queries without create view and they worked. I don’t know what is causing the error I have tried changing the parenthesis but I get the same errors. The only time it works is when I put explain plan before SELECT TEAMS, TIMES. Thank you!

Advertisement

Answer

The documentation of EXPLAIN PLAN says

The EXPLAIN PLAN statement displays execution plans that the optimizer chooses for SELECT, UPDATE, INSERT, and DELETE statements.

Source: SQL Tuning Guide

You can probably fish out the execution plan of the CREATE VIEW statement, but it will be uninteresting. Only the syntax of the query is checked, your access to the tables, and the query will be stored in USER_VIEWS.

I guess what you want to know is the performance of the query itself. You’d do this with

User contributions licensed under: CC BY-SA
1 People found this is helpful
Advertisement