Chapter 7 WORKING WITH VIEWS 427 each member

Chapter 7 WORKING WITH VIEWS 427 each member table. It is possible to create updateable partitioned views. This requires that each table s SELECT statement refers to only one base table, the UNION ALL operator is used to join the resultsets together, and non-local tables use the full four-part identifier in their names. To decide whether you should create a partitioned view or not, you have to examine the data you will be working with, and consider how it is used. If you have a table that is used by many different department or regions (each with its own server), then you can look at partitioning the database along those lines. For example, a company sells five major product lines. Each product line is managed by a department and each department has its own SQL Server for its specific data. All customers in the organization buy products from only one department, and there is no crossover between product lines, but all customers are stored in one table, which is stored on a central server. When looking for its own customers, each department must then SELECT against the central table, sifting through the entire customer base. Thought has been given to splitting the data into separate customer tables, but the central billing application requires that all the data be stored in one table. In this scenario, you have an ideal candidate for a distributed (updateable) partitioned view. The customer table can be divided into tables based on product line, and joined together by a partitioned view. This enables each table to be queried individually or through the view. The CHECK constraint can be based on the product line that the customer purchases, enforcing which server is to hold the data. Even if the view is queried, the CHECK constraint is used to determine which servers and tables actually have to be queried. If the SELECT against the view uses a WHERE clause to specify product1 and product2, then only the servers that contain those products are queried. This reduces the volume of data that is actually queried against. In this scenario, the central billing application can make use of the partitioned view, and it appears that all the data still resides in one table. Now you have enough knowledge of partitioned views to actually implement them, which you will do in the next section. continues

For high quality website hosting services please check tomcat web hosting website.

Comments are closed.