What is meant by 'query modification' as an approach to implementing views?
Just doing some revision, and one of the questions is:
"Explain what is meant by 'query modification' as an approach to implementing views."
Now, I'm not quite sure how to answer that... I know wh开发者_StackOverflow中文版at views are, how to create them and why they are used etc, but what exactly does that question want to know?
This is a theoretical concept from David Meier's works on relational theory.
When you are using a view in your queries, like this:
CREATE VIEW v_filtered
AS
SELECT *
FROM mytable
WHERE mycolumn = 1
SELECT *
FROM v_filtered
JOIN othertable
ON otherid = myid
, to execute your query, a database engine should be able to rewrite the query over the virtual relations (like your view) to one using the base relations, since that what is actually stored:
SELECT *
FROM mytable
JOIN othertable
ON otherid = myid
WHERE mycolumn = 1
This process is called query modification.
精彩评论