这是两个视图的简化版本:
viewA is select * from myTable;
viewB is select * from viewA;
直接从 viewA 选择和从 viewB 选择之间是否有任何性能差异,因为从 viewB 选择有另一层是 viewA?
CREATE OR REPLACE FORCE VIEW "VIEWA" ("TITLE", "VALUE1", "VALUE2", "ID") AS
select "TITLE","VALUE1","VALUE2","ID" from dati
/
CREATE OR REPLACE FORCE VIEW "VIEWB" ("TITLE", "VALUE1", "VALUE2", "ID") AS
select "TITLE","VALUE1","VALUE2","ID" from viewa
/
解释从 viewA 中选择 * 的计划
Operation Options Object Rows Time Cost Bytes Filter Access
Predicates * Predicates
SELECT STATEMENT 4 1 3 268
TABLE ACCESS STORAGE FULL DATI 4 1 3 268
解释从 viewB 中选择 * 的计划
Operation Options Object Rows Time Cost Bytes Filter Access
Predicates * Predicates
SELECT STATEMENT 4 1 3 268
TABLE ACCESS STORAGE FULL DATI 4 1 3 268
我的回答必须是:不,没有任何性能差异。