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


Partition


Partition

Author
Message
ningaraju.n
ningaraju.n
SSC Veteran
SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)

Group: General Forum Members
Points: 220 Visits: 425
Hi All,

I have a table which has around 50 million records and its increasing exponentially, and it stores the information of user and his attended question details for eg:sample data looks like this
ScheduleUserId,QuestionId,MaxScore,UserScore,IsCorrect,HintUsed
2345 32 2 2 1 0
2345 33 2 0 0 0

etc

we thought of doing the partition please provide some good approaches for this .
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCrazy Eights
SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)

Group: General Forum Members
Points: 9089 Visits: 7283
Question to consider:
> which column is likely to be used in range-based searches (usually the column with the clustered index)?
This would be the column to effect the partition on, e.g. using range left for customer for values 1000, 2000, 3000 etc
> how many filegroups and physical files would be required (to split the data accross numerous drives, if applicable)?

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
ningaraju.n
ningaraju.n
SSC Veteran
SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)

Group: General Forum Members
Points: 220 Visits: 425
Thanks stewart,

We are using the scheduleuserid in most of the cases in where clause and sometimes questionId along with that.
and currently we have only one file group .
please suggest.
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCrazy Eights
SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)

Group: General Forum Members
Points: 9089 Visits: 7283
ningaraju.n (8/25/2010)
Thanks stewart,

We are using the scheduleuserid in most of the cases in where clause and sometimes questionId along with that.
and currently we have only one file group .
please suggest.

based on you reply, I would recommend
> creating at least one new filegroup (with associated physical file);
> build the partition function using the column most frequently used in range-based searches (scheduleuserid), using, for example, the ranges as shown in my first post on this subject;
> create the partition scheme to link the partition function to the new filegroup;
> build the table on the new partition scheme;
> create the clustered index on the partitioned column, also on the new partition scheme;
> Refer to books online with regard to the rules governing indexes on partitioned tables: http://msdn.microsoft.com/en-US/library/ms188706(v=SQL.90).aspx

or Kimberly Tripp's article: http://msdn.microsoft.com/en-us/library/ms345146(SQL.90).aspx

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
Marcos Leandro Rosa
Marcos Leandro Rosa
Valued Member
Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)Valued Member (62 reputation)

Group: General Forum Members
Points: 62 Visits: 71
Hi,
Just a matter of complementing our friend's answer:

How many disk do you have available to spread your files?
Why do you want to split your table? [Is it for increasing performance?]::[Is it a matter of space?]

You have also to create a Partitioned Index and not just common index to get best performance.


First of all you have to measure why you want to have the database split then we can go with further investigation.



You can see my youtube channel I have a video talking about partitioned tables
http://www.youtube.com/watch?v=HDx8XCoAw3w

Best Regards,
Marcos Rosa / marcosfac@gmail.com

ningaraju.n
ningaraju.n
SSC Veteran
SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)

Group: General Forum Members
Points: 220 Visits: 425
Thanks stewart,

I understand most of your points except the below point
>build the table on the new filegroup
I have to do partition for existing table

and can you please suggest the way to do that point('build the table on the new filegroup')
ningaraju.n
ningaraju.n
SSC Veteran
SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)SSC Veteran (220 reputation)

Group: General Forum Members
Points: 220 Visits: 425
Thanks Rosa,

I don't know about the availability of disks,but we want partition to improve the performance

Please suggest in this regard
Stewart "Arturius" Campbell
Stewart "Arturius" Campbell
SSCrazy Eights
SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)SSCrazy Eights (9.1K reputation)

Group: General Forum Members
Points: 9089 Visits: 7283
ningaraju.n (8/25/2010)
Thanks stewart,

I understand most of your points except the below point
>build the table on the new filegroup
I have to do partition for existing table

and can you please suggest the way to do that point('build the table on the new filegroup')


There are 2 methods of doing so.
Please refer to http://msdn.microsoft.com/en-US/library/ms175864(v=SQL.90).aspx for details (specifically the section regarding Converting a Nonpartitioned Table to a Partitioned Table)

____________________________________________
Space, the final frontier? not any more...
All limits henceforth are self-imposed.
“libera tute vulgaris ex”
antonyrajcletus
antonyrajcletus
Grasshopper
Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)Grasshopper (11 reputation)

Group: General Forum Members
Points: 11 Visits: 7
Hi

Actually I have a requirement as below

1) To have a database in sql server 2008 with a set of tables (which will have the fields snapshotdate and frequency along with other data fields)
2) This set of tables should maintain only the latest 2 daily snapshot dates of data and latest 3 monthly snapshot dates of data and the older one should be removed everytime the new data comes in.

--> Please let me know the complete steps of how we can do it through partitions in SQL server 2008 which I require very urgently

Thanks,
Cletus
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