This is a discussion on Vertical Partitioning within the MS SQL ODBC forums, part of the Microsoft SQL Server category; --> could anybody plz tell me how to vertically partition a table in SQL Server 2000. Is a view built ...
| |||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| ||||
| could anybody plz tell me how to vertically partition a table in SQL Server 2000. Is a view built over the partitioned tables just as it is done in case of horizontal partitioning? If no, then how are the different operations of insert,update,delete performed? What is better to use horizontal partitioning or vertical partitioning? Plz help. Regards |
| ||||
| Horizontal and vertical partitioning are not directly related, which is better for a situation depends on the situation itself. Vertical partitioning means breaking something up with a lot of columns into separate objects with fewer columns. So instead of one table with 10 columns, you would create maybe one table with 3 columns and one table with 7 columns. The formal term for the process is called normalization. It means you break up tables into smaller tables so they would describe only one entity. Say you had a table called orders. It had columns for customer, product and price. What if you had a product that no one had bought yet? What you should have is a table called product with the prices next to each product then a separate table called customers, then the products they want. That is vertical partionining. Horizontal partitioning breaks extremely large tables into smaller tables by isolating rows in sub tables. The amount of columns stay the same. If you had an orders table with a year column, you create two subtables, one that stored orders for 2002, one for 2003. To see multiple vertically partitioned tables in a view, you would use a join on the columns that are related to each other eg (from pubs, you could create a view as CREATE VIEW author_title AS SELECT a1.au_lname, t.title FROM authors a1 inner join titleauthor t1 on a1.au_id = t1.au_id , titleauthor t2 inner join titles t on t2.title_id = t.title_id For Horizontal partioning you can use the UNION statement for multiple selects. I'm using the same table twice in this example, but you don't have to as long as the columsn align CREATE VIEW authorname as SELECT au_lname from authors where au_lname like 'c%' UNION ALL SELECT au_lname from authors where au_lname like 'B%' From the what I've been studying for my sql 2000 upgrade, the restrictions are on views are as follows -- 1) data can only be updated one underlying table in the view at a time. In the join example, you could only update data in titles, but not titleauthor in the same statement. 2) You cannot modify data in a few that contains aggregrated columns. With these restrictions in mind, you can create triggers to do the work for you. Good luck. Also remember that vertical and horizontal partitioning are terms frequently used in replication as well, since decisions about what data to replicate are extremely critical. -- *********************************** Andy S. andy_mcdba@yahoo.com *********************************** "Harman Dhillon" <harmand@grapecity.com> wrote in message news:ejSHGldfDHA.1732@TK2MSFTNGP12.phx.gbl... > could anybody plz tell me how to vertically partition a table in SQL Server > 2000. Is a view built over the partitioned tables just as it is done in case > of horizontal partitioning? If no, then how are the different operations of > insert,update,delete performed? > > What is better to use horizontal partitioning or vertical partitioning? > > Plz help. > > Regards > > > > |