SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Appropriate range for partitioning


Appropriate range for partitioning

Author
Message
mah_j
mah_j
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1117 Visits: 1262
Hi

I have a large table which there is just select and insert on it.It has a field named 'TranType'(int) and for some of the types we just have insert and no select at all.

I want to use partitioning to separate this data into another file.but there is not any particular range for values . For example the types with no select are:1004,1006,1007,1009,1010,2000


How can i use the CREATE PARTITION FUNCTION in this case?

CREATE PARTITION FUNCTION PartitionDB_PartitionRange (INT)
AS RANGE LEFT FOR
VALUES (????);



Another basic question about partitioning:
I have a table like this


CREATE TABLE [dbo].[Trans]
(
[Num] [int] NOT NULL,
[Date] [datetime] NOT NULL,
[ID] [bigint] NULL,
[Kind] [int] NULL,
[Success] [bit] NULL,
[CNum] [nvarchar](20) NULL,
[Data] [nvarchar](4000) NULL,
[Counter] [int] NOT NULL,
[IP] [nvarchar](25) NULL,
[Result] [int] NULL,
CONSTRAINT [PK_Trans] PRIMARY KEY CLUSTERED([Num] ASC, [Date] ASC)
WITH (
PAD_INDEX = OFF,
STATISTICS_NORECOMPUTE = OFF,
IGNORE_DUP_KEY = OFF,
ALLOW_ROW_LOCKS = ON,
ALLOW_PAGE_LOCKS = ON
) ON [PRIMARY]
) ON [PRIMARY]


so it has a Clustered Index For PRIMARY KEY and 6 NonClustered Indexes.

for partitioning on the feild "kind" should i drop all the FK and PRIMARY KEY,and create a new CLUSTERED Index on kind feild?

there isnt any way that i dont have to drop all this indexes and FK s?
GilaMonster
GilaMonster
SSC Guru
SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)

Group: General Forum Members
Points: 369825 Visits: 46948
First question. Why are you partitioning? What's the purpose, what's the goal?

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


mah_j
mah_j
Ten Centuries
Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)Ten Centuries (1.1K reputation)

Group: General Forum Members
Points: 1117 Visits: 1262
There is a sharply increase in the size of transactions that is inserted in that table,and if i can do partitioning the remaining range of kind field will be half,and the performance of select statements on the table will be increased,also i think the page split would be decreased in the partition that i want to select from it.
GilaMonster
GilaMonster
SSC Guru
SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)SSC Guru (369K reputation)

Group: General Forum Members
Points: 369825 Visits: 46948
If you are partitioning with the idea that queries are automatically faster on partitioned tables, don't waste your time.

Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

We walk in the dark places no others will enter
We stand on the bridge and no one may pass


Bhuvnesh
Bhuvnesh
SSC-Insane
SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)SSC-Insane (21K reputation)

Group: General Forum Members
Points: 21494 Visits: 4079
mah_j (12/10/2012)
also i think the page split would be decreased in the partition that i want to select from it.
NO , partitoning is not related with page spliting and
for partitiioning see this http://www.brentozar.com/archive/2012/03/how-decide-if-should-use-table-partitioning/

-------Bhuvnesh----------
I work only to learn Sql Server...though my company pays me for getting their stuff done;-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search