473,396 Members | 2,030 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

views across databases

Hi,
I am trying to locate documentation on using views across databases.
We have serveral databases broken down by application, some shared
databases and some location specific databases supporting multiple
facilities using the applications. The DBA for our client is the one
that set up the topology of these databases but I don't understand the
performance considerations of having views in an applictation database
referencing tables in the shared databases. Is the enitre table
copied to tempdb when the view is referenced? How does indexing in
the containing database affect access through the view? These are
some of the questions I would like see documenation on.

Thanks,
Jim
Jul 20 '05 #1
3 2693

<ji**********@msn.com> wrote in message
news:ac**************************@posting.google.c om...
Hi,
I am trying to locate documentation on using views across databases.
We have serveral databases broken down by application, some shared
databases and some location specific databases supporting multiple
facilities using the applications. The DBA for our client is the one
that set up the topology of these databases but I don't understand the
performance considerations of having views in an applictation database
referencing tables in the shared databases. Is the enitre table
copied to tempdb when the view is referenced? How does indexing in
the containing database affect access through the view? These are
some of the questions I would like see documenation on.

Thanks,
Jim


Essentially, a view has no physical existence, and is purely logical - when
you execute a query which references a view, the view name is replaced with
its definition (it's 'expanded'), and then the query is parsed and executed.
That means that the query optimizer will look directly at the base tables in
the other database, and consider indexes on them as usual. There's no
special reason why tempdb would be used, unless it's needed anyway in the
query, perhaps to sort a large result set.

If you have an indexed view (MSSQL 2000 only), then the situation is rather
different - the view then does exist physically (at least in the form of
indexes), and the optimizer will look at the view's indexes rather than go
to the base tables.

Any issues are probably more to do with management (is the other database
always there?) than performance. Although if the view points at a database
on a different server, then there could easily be significant performance
implications.

See "Creating a View" and "Creating an Indexed View" in Books Online for
more details.

Simon
Jul 20 '05 #2
>
Essentially, a view has no physical existence, and is purely logical - when
you execute a query which references a view, the view name is replaced with
its definition (it's 'expanded'),


Hi Simon,
Thanks for taking the time to answer but what I am trying to find out
is a little deeper I think. I understood that views were just stored
queries when you were working within a database. What I was looking
for was something that described in a more definitive detail how the
fact that the view is in a different database "changes" the rules. Is
there an increased cost in accessing the index pages becuase you are
crossing database boundaries? Obviously since the databases are in
separate files, the first access will require disk I/O. Is the memory
shared between all databases in a seamless manner. I have read the
sections you mentioned as well as anything else in books online but
have not found this level of detail.

jim
Jul 20 '05 #3
ji**********@msn.com wrote in message news:<ac**************************@posting.google. com>...

Essentially, a view has no physical existence, and is purely logical - when
you execute a query which references a view, the view name is replaced with
its definition (it's 'expanded'),


Hi Simon,
Thanks for taking the time to answer but what I am trying to find out
is a little deeper I think. I understood that views were just stored
queries when you were working within a database. What I was looking
for was something that described in a more definitive detail how the
fact that the view is in a different database "changes" the rules. Is
there an increased cost in accessing the index pages becuase you are
crossing database boundaries? Obviously since the databases are in
separate files, the first access will require disk I/O. Is the memory
shared between all databases in a seamless manner. I have read the
sections you mentioned as well as anything else in books online but
have not found this level of detail.

jim


As far as I know, the rules don't change - the object name is
resolved, and the fact that the table is another database doesn't
matter. (Assuming no complications arising from cross-database
ownership chains, permissions, remote databases, databases set to
auto-close etc.) I quickly skimmed through chapter 15 of Inside SQL
Server 2000 (the bible of MSSQL internals) which discusses the query
processor, and while I may have missed something, I didn't see
anything to suggest that querying a table in another database is in
any way different from querying a table in the current database (since
the view is, as mentioned, expanded anyway).

If you're looking for 'low-level' information on any part of MSSQL
internals, then I highly recommend Inside SQL Server 2000.

Simon
Jul 20 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: ChronoFish | last post by:
Hi there, We have just loaded 5.01 so that we can take advantage of views. One question I have before I start experimenting is this: Can you "view" across databases? And if the answer is yes,...
3
by: Damon | last post by:
I've searched for information on this but so far have not been able to find any advice. We have several databases running on SQL Server 7.0 that are essentially identical in structure but are...
3
by: dbtoo_dbtoo | last post by:
One of the databases has 50 views and when I do a db2look I only get schema for 40 of them. If I select from the sysviews, I can see all 50 (the text column contains schema for all 10 (missing)...
0
by: Fan Ruo Xin | last post by:
I installed Stinger in my PC (w2k). I need to do a quick compare between DB2 OLAP server and DB2 Cube Views. And I only found DB2 Cube Views version8.1 trial code from IBM website. I didn't want to...
6
by: Damon Grieves | last post by:
Hi I just want to be sure I understand how the Access client works. If I have an Access back end with a million records on a server and an Access client. If the client is installed on the users pc...
15
by: rod.weir | last post by:
Fellow database developers, I would like to draw on your experience with views. I have a database that includes many views. Sometimes, views contains other views, and those views in turn may...
33
by: Peter | last post by:
People are telling me it is bad to put select * from <atable> in a view. I better should list all fields of the table inside the definition of the view. I dont know exactly why but some...
4
by: Laurence | last post by:
Hi folks, Who knows how to create multi-location/global views? Could you show me some examples? Thanks in advance, Laurence
1
by: Neil Chambers | last post by:
I currently have 2 databases with one website per DB. The databases are simple collections of views and some tables holding keys for the views - these DBs are exact copies of eachother, other than...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.