Re: internal handling of views



On 2006-08-06, HansF <Fuzzy.Greybeard@xxxxxxxxx> wrote:
On Sun, 06 Aug 2006 10:39:12 -0500, Charles M wrote:


Im not sure what you mean here by conceptually true. If its true then updating
the table source would indeed have an instantaneous effect on the view
(because the data element is the same).

Yes. That is, in fact, what happens.


<snip>


A view is nothing more than a STORED SELECT. It is evaluated at run time.
Since the details are stored, the optimizer may elect to merge the
definition of the view with other information, should the view be used in
a compound situation, such as a join ... it is possible that the original
view may not 'executed' in such a situation.

There is no 'data' attached to the view. It is in the table (and only in
the table).


<snip>



All of this is in the concepts manual, and can easily be proven through
simple tests.



Thanks for the reply Hans. The problem I have with the concept manual is
that it states that a view can be THOUGHT OF (emphisis mine) as a stored
query or virtual table. Well, when someone says something can be thought of,
they usually mean thats not what it truly is, or they would have use IS
instead of THOUGHT OF. So, I'm unsure if the concept manual is just talking
this tact from there on forward or if they really, really mean thats what it
is.

Also in discussing mechanics of a view the manual says that sql involving a
view is merged with the views definition (its stored sql). Well, thats all
fine and for selecting from a view, but how does it work for updating a view?
You can't do an 'update .. select from' if the from doesn't contain any data.
It would have to do (possibly complex) logic to figure out where the elements
go, not merely merging a select query. On the other hand, the pointer
description works just fine for this, and as best I can tell gives all the
other characteristics of a view as well. But I've only run across the pointer
definition once (read somewhere or told by a DBA - don't recall) and every
book I've seen since mentions the stored query definition. So I'm faced with
an answer that makes more sense but from a source that may be suspect, or the
more prevalent definition.

Anyway, thanks again for the reply.

CMM


.



Relevant Pages

  • Re: Nearest Common Ancestor Report (XDb1s $1000 Challenge)
    ... >> only one active application (Query Analyzer). ... I did notice that both the data and log files for the ... but with the options SET STATISTICS TIME and SET STATISTICS ...
    (comp.object)
  • Re: need procedure for exporting from Access to Excel
    ... >> duplicated in Excel. ... >> 1) build and execute a SQL query that selects the record in the Access ... create an append query that appends records from the Access table to ...
    (microsoft.public.access.externaldata)
  • Re: Range query optimization help?
    ... > instead of the 10+ hours that the naive query took. ... Well, since your problem is a common range lookup problem, the query was ... If this index is not automatically used in the correlated subquery, ...
    (microsoft.public.sqlserver.programming)
  • Re: Madeleine McCann
    ... You'r IP has remained constant since last september. ... (at least thats how far back I bothered reading). ...
    (talk.origins)
  • Re: OT: I want one of these...
    ... <SNIP> ... > Thats not the point. ... As well as the actual smoke there is the disposal ... > of the butts. ...
    (uk.rec.motorcycles)