I'm having trouble understanding performance with queries on views. Given this two scenarios, the queries internally will be the same?
SCENARIO 1
View:
CREATE VIEW TEST.SIMPLEVIEW AS
SELECT
TABLE1.*,
TABLE2.*
FROM TABLE1
INNER JOIN TABLE2 ON
TABLE1.id = TABLE2.fk_id;
Query:
SELECT * FROM SIMPLEVIEW WHERE status = 'P'; -- P in select
SCENARIO 2
View:
CREATE VIEW TEST.SIMPLEVIEW AS
SELECT
TABLE1.*,
TABLE2.*
FROM TABLE1
INNER JOIN TABLE2 ON
TABLE1.id = TABLE2.fk_id
WHERE TABLE1.status = 'P'; -- P in view definition
Query:
SELECT * FROM SIMPLEVIEW;
QUESTION
The queries internally will be the same? Disregarding the fact that the condition of status would be or not permanent one.