Skip to main content

Brief Theoretical Knowledge about Table Partitioning

1. Partitioning is fully depended on Filegroups.

2. Start table partitioning as early as possible. So that huge data movement can be avoided later.

3. A file would be grouped to one and only Filegroups. Actually Filegroups improves database maintenance, performance and Online restore.

4. For your information, default Filegroup is always “primary filegroup“. If at all you don’t believe me! Create a dummy table something like this,

Create Table Test
(
sno int
)
Go

Now in your SQL Mgmt Studio, right click on that table and check the properties yourself.

5. All “System Objects” have to belong to PRIMARY Filegroup.

6. It’s recommended, to have all “User Objects” created in another Filegroup.

7. In SQL Server 2000, any user object can’t belong to more than one Filegroup. But it’s possible now in SQL Server 2005. That is, a table data can be partitioned and stored into multiple Filegroups.

8. If you have two large tables, put them into different Filegroups. Filegroups are recommended being on two different “Physical” drives.

Physical drive (hard disk) – has a spindle which has “reads per second”, “writes per second” which in turn determines the performance. While joining these 2 tables, parallel retrieval happens based on their spindle speed (since it involves two different physical drives). So there would be a boost in performance.

9. Filegroups are database specific. That is, if you create a “Filegroup1” for Database1 it won’t be available for any other databases.

10. Tables and Indexes can reside on different Filegroups.

11. Partition can be created based on the “Partition key”. Typically it would be based on the
“Date” field.

12. People querying the table need not bother about fetching records from different partition. Because SQL Engine takes care of it internally.

13. You can create separate partition for storing historic data.

14. Maintenance plan needs to be created based on the Filegroup.

15. By the way, we can set Filegroup as Read-only also. Lookup tables or tables which don’t go to change at all needs to be placed in Read-only groups. So it’s enough if we backup this Filegroup once.

16. In SQL Server 2000, we need to “Restore” all Filegroups then only we can make the database online. In SQL Server 2005, once the Primary Filegroup is up we can bring the database online. So functionality wise grouping should be done in a Filegroup.

In the next post I would talk about the steps involved in creating a partition and the different types of operations in a partition.

Technorati tags: ,

Comments

Anonymous said…
4. For your information, default Filegroup is always “primary filegroup“. If at all you don’t believe me! Create a dummy table something like this,

Create Table Test
(
sno int
)
Go

Alter database xyz modify filegroup abc default;

will change the default filegroup for new object creation.
Vadivel said…
Thats true. My argument holds good as long as the users haven't changed their default filegroup of installation :)

Popular posts from this blog

Script table as - ALTER TO is greyed out - SQL SERVER

One of my office colleague recently asked me why we are not able to generate ALTER Table script from SSMS. If we right click on the table and choose "Script Table As"  ALTER To option would be disabled or Greyed out. Is it a bug? No it isn't a bug. ALTER To is there to be used for generating modified script of Stored Procedure, Functions, Views, Triggers etc., and NOT for Tables. For generating ALTER Table script there is an work around. Right click on the table, choose "Modify" and enter into the design mode. Make what ever changes you want to make and WITHOUT saving it right click anywhere on the top half of the window (above Column properties) and choose "Generate Change Script". Please be advised that SQL Server would drop actually create a new table with modifications, move the data from the old table into it and then drop the old table. Sounds simple but assume you have a very large table for which you want to do this! Then it woul

AWS fatal error: An error occurred (400) when calling the HeadObject operation: Bad Request

While using AWS and trying to copy a file from a S3 bucket to my EC2 instance ended up with this error message. Command Used: aws s3 cp s3://mybucketname/myfilename.html /var/www/html/ Error: fatal error: An error occurred (400) when calling the HeadObject operation: Bad Request The error goes off if we add the region information to the command statement. I am using Asia Pacific (Mumbai) so used ap-south-1 as the region name. Modified Command: aws s3 cp s3://mybucketname/myfilename.html /var/www/html/ --region ap-south-1

[Non Tech] Want to know the recipe for Omelette :)

Fed up with Bread - Jam and Curd Rice, today i wanted to eat Omelette. Interesting part is I wanted to cook it myself :) So in the first picture you see all the items which are needed for preparing an Omelette. When I had a closer look at the eggs I see that almost all the eggs are broken. But believe me when I bought it couple of days back it was in perfect condition! I was wondering whether the eggs have become rotten or pretty old to consume! I tried taking an egg and break it but couldn't break it at all :) Since I have kept in the freezer all the eggs have frozen and looked like a iron ball :) After trying for few minutes of trying i removed the shell of the egg and then kept that iron ball :) into a bowl and placed it within Oven. I heated it for 1 minute and checked. It melted only to a limit. So i just set it for another 2 minutes and checked it later. It has melted but the part of the egg white has become a Omelette :( I didn't leave it there. I took the bowl out of