Is it possible to column partitioning in SQL Server

自作多情 提交于 2019-12-13 16:17:38

问题


The size of each record of table is a performance parameter. that means if size of record was small SQL Server fetch more records in each read from physical hard.

In most of our queries we not use all column of table, and may be some column use only in specific query. Is it possible for we partitioning columns of each table to have better performance.

I use SQL Server 2008 R2.

Thank you.


回答1:


True column level partitioning comes with column oriented storage, see Inside the SQL Server 2012 Columnstore Indexes, but that is available only in SQL Server 2012 and addresses specific BI workloads, not general SQL Server apps.

In row oriented storage the vertical partitioning is actually another name for designing proper covering indexes. If the engine has an alternative narrow index it will use it instead of the base table, when possible.

The last alternative, manually splinting the table and joining the vertical 'shards' in queries (or defining joining views, same thing) is usually ill advised and seldom pays off.




回答2:


At the moment with SQL Server 2008, you cannot partition tables horizontally. If you have a large number of columns, you would need to chop it into horizontal chunk tables that share a common key and then skin them with an update-able view to give the illusion of one very wide table.

If there are just a few large columns (e.g. VARCHAR(1000)), you can normalize your data into unique value tables.




回答3:


The one exception to the no column partitioning rule are character columns declared as max (varchar(max), for example).

These are stored on a separate data page. I believe this page is not read in unless the column is referenced in the query. If I am wrong, I'am sure more knowledge people will correct me.



来源:https://stackoverflow.com/questions/10931731/is-it-possible-to-column-partitioning-in-sql-server

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!