473,594 Members | 2,713 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2707

<ji**********@m sn.com> wrote in message
news:ac******** *************** ***@posting.goo gle.com...
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**********@ms n.com wrote in message news:<ac******* *************** ****@posting.go ogle.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
1436
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, can you "view" across servers? Given two tables "company" and "people", each living in a different database (and potentially on different servers) can you give an example (the SQL) of how to link them in a view?
3
1400
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 used for different data. There are several tables that are identical in all databases. Currently, we make updates to those tables in one database and propogate the new versions of those tables to the other databases. The maintenance to keep after...
3
9958
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) views). What's going on here? Why can't or how can I get the schema for these 10 views. Aix 5.1 V7.2 EE FP9 Thanks.
0
1806
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 spend a lot of time on this. So I installed the Cube Views 8.1, without uninstall ESE V8.2 code first last Friday. It looks like everything was OK. But I failed to start DB2 Information Center and DB2 CC today. I've seen process - javaw used...
6
2121
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 and run by the user...does Access drag the whole million records across the LAN when we call up one record ie filters for that record locally? If the client is on the same server as the back end, and the user starts up the client on the server...
15
3057
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 contain views. In fact, I have some views in my database that are a product of nested views of up to 6 levels deep! The reason we did this was. 1. Object-oriented in nature. Makes it easy to work with them.
33
6637
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 say: A select * from makes sql server does a table scan.
4
1645
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
973
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 the item values needed to generate different views. The two websites are also identical but simply require different ConnectionString items to point to the relevant database. I am happy keeping the separate databases as some of the views, whilst...
0
7946
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7876
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8372
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
6654
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
5739
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
3897
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2385
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1478
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1210
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.