Question about table partitioning...

Hello, all.  I'm using SQL 2012 Enterprise.  I have 8 very large tables (the largest two having 227M and 118M records, and the others between 11M-44M records).  For performance reasons, I'm considering partitioning the tables across multiple
files/filegroups.  For my largest table (227M records), the data is spread across years 2011, 2012, and 2013 with 2013 having 104M records.  So naturally I'm considering partitioning on a Date column.  My question is should I go with four partitions
(2011, 2012, 2013 and 2014 for new data) and still end up with a very large aggregation of data on the 2013 partition (104M) or should I further breakdown the 2013 partition into months now having 12 partitions for 2013 alone, and then I'm OK with all
of 2011 and 2012 on their own partitions.  Again, this is for one table.  I'd still like to partition the other 7 large tables.  In the end, I could end up with many, many partitions and hence many, many filegroups.  I'm interested in how
others partition MULTIPLE large tables.  Can you share partition functions/schemes across tables?
Any thoughts, your own personal experiences, etc would be greatly appreciated.  Also, can someone recommend a good book, article, blog, etc on partitioning large databases.
Thanks much in advance.
Roz

If you query against more than one partition I have doubts  you will gain performance...
-- Create partition functions
CREATE PARTITION FUNCTION PF1(INT) AS RANGE RIGHT FOR VALUES (1, 2, 3);
CREATE PARTITION FUNCTION PF2(INT) AS RANGE RIGHT FOR VALUES (1, 2);
-- Create filegroups
ALTER DATABASE testdb ADD FILEGROUP FG7;
ALTER DATABASE testdb ADD FILEGROUP FG6;
ALTER DATABASE testdb ADD FILEGROUP FG5;
ALTER DATABASE testdb ADD FILEGROUP FG4;
ALTER DATABASE testdb ADD FILEGROUP FG3;
ALTER DATABASE testdb ADD FILEGROUP FG2;
ALTER DATABASE testdb ADD FILEGROUP FG1;
-- Create partition schemes
CREATE PARTITION SCHEME PS1 AS PARTITION PF1
TO (FG1, FG2, FG3, FG4);
CREATE PARTITION SCHEME PS2 AS PARTITION PF2
TO (FG5, FG6, FG7);
CREATE VIEW [dbo].[partition_info] 
AS
SELECT
DB_NAME() AS 'DatabaseName'
,OBJECT_NAME(p.OBJECT_ID) AS 'TableName'
,p.index_id AS 'IndexId'
,CASE
WHEN p.index_id = 0 THEN 'HEAP'
ELSE i.name
END AS 'IndexName'
,p.partition_number AS 'PartitionNumber'
,prv_left.value AS 'LowerBoundary'
,prv_right.value AS 'UpperBoundary'
,ps.name as PartitionScheme
,pf.name as PartitionFunction
,CASE
WHEN fg.name IS NULL THEN ds.name
ELSE fg.name
END AS 'FileGroupName'
,CAST(p.used_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'UsedPages_MB'
,CAST(p.in_row_data_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'DataPages_MB'
,CAST(p.reserved_page_count * 0.0078125 AS NUMERIC(18,2)) AS 'ReservedPages_MB'
,CASE
WHEN p.index_id IN (0,1) THEN p.row_count
ELSE 0
END AS 'RowCount'
,CASE
WHEN p.index_id IN (0,1) THEN 'data'
ELSE 'index'
END 'Type'
FROM sys.dm_db_partition_stats p
INNER JOIN sys.indexes i
ON i.OBJECT_ID = p.OBJECT_ID AND i.index_id = p.index_id
INNER JOIN sys.data_spaces ds
ON ds.data_space_id = i.data_space_id
LEFT OUTER JOIN sys.partition_schemes ps
ON ps.data_space_id = i.data_space_id
LEFT OUTER JOIN sys.partition_functions pf
ON ps.function_id = pf.function_id
LEFT OUTER JOIN sys.destination_data_spaces dds
ON dds.partition_scheme_id = ps.data_space_id
AND dds.destination_id = p.partition_number
LEFT OUTER JOIN sys.filegroups fg
ON fg.data_space_id = dds.data_space_id
LEFT OUTER JOIN sys.partition_range_values prv_right
ON prv_right.function_id = ps.function_id
AND prv_right.boundary_id = p.partition_number
LEFT OUTER JOIN sys.partition_range_values prv_left
ON prv_left.function_id = ps.function_id
AND prv_left.boundary_id = p.partition_number - 1
WHERE
OBJECTPROPERTY(p.OBJECT_ID, 'ISMSSHipped') = 0
AND p.index_id IN (0,1)
GO
Best Regards,Uri Dimant SQL Server MVP,
http://sqlblog.com/blogs/uri_dimant/
MS SQL optimization: MS SQL Development and Optimization
MS SQL Consulting:
Large scale of database and data cleansing
Remote DBA Services:
Improves MS SQL Database Performance
SQL Server Integration Services:
Business Intelligence

Similar Messages

  • Question on table partition

    Hi Again OTN Peeps,
    I have a question about copying from one table to another table.
    The table that i need to copy is partitioned.
    I'm checking the internet on how to copy data of the table per partition. But I'm not able to see a better explanation.
    Can anyone help me and guide me on how to copy table data per partition?
    Thanks Again!

    Found a way :)
    Thanks all

  • Question about the partition index

    Hi, all, I have some questions about partitioned index.
    And I get from oracle documents that oracle's partition index can be clarified as local partition index and global partition index.
    And local partition index can be clarified as prefix local partition index and non-prefix local partition index. And I also the word "global prefix partition index".
    But, I can not get what the exact meaning after I consulted many documents and notes from website.
    Can anyone give me one example to cover these topic?
    You help is very thankful!
    Thanks and best regards!

    Hi,
    Local index search by partition.
    Local Indexes: A local index is an index on a partitioned table which is partitioned in the exact same manner as the underlying partitioned table. Each partition of a local index corresponds to one and only one partition of the underlying table.
    Global Partitioned Indexes: A global partitioned index is an index on a partitioned or non-partitioned table which is partitioned using a different partitioning-key from the table. Global-partitioned indexes can only be partitioned using range partitioning. For example, a table could be range-partitioned by month and have twelve partitions, while an index on that table could be range-partitioned using a different partitioning key and have a different number of partitions.
    Global Non-Partitioned Indexes: A global non-partitioned index is essentially identical to an index on a non-partitioned table. The index structure is not partitioned.
    Maybe this links help you:
    http://www.oracle.com/technology/products/oracle9i/datasheets/partitioning.html
    http://asktom.oracle.com/pls/ask/f?p=4950:8:12026637104196321871::NO::F4950_P8_DISPLAYID,F4950_P8_CRITERIA:678824574412
    http://asktom.oracle.com/pls/ask/f?p=4950:8:::::F4950_P8_DISPLAYID:1612281449571
    Cheers

  • Question about table compression

    I administer several 10g databases, and have been asked to compress tables in several tablespaces. I am unfamiliar with using compression. I have read some Oracle documentation on the ALTER TABLE... MOVE COMPRESSION command, but still have several questions. Can anyone recommend a good white paper, or other documentation on how best to compress tables with existing data? Thank you in advance for your guidance!

    Basically, I have questions about how to select which tables will benefit from compression. I also read somewhere that, once a table has been compressed, new updates to the compressed data will not be compressed and so I will need to re-compress the tables periodically.
    I also needed to know if the ALTER TABLE statement will compress the existing data or just future inserted data. Through further research I found that by using the MOVE clause, it will compress the existing data. I will also need to rebuild the indexes once the ALTER TABLE statement is complete.
    Thank you for your help and encouragement!

  • Question about table DR$FND_LOBS_CTX$I

    All,
    I have questions about this table 'DR$FND_LOBS_CTX$I'
    1. What's the purpose of this table?
    2. Can we purge this table? How?
    3. Is there any harmful if purge this table?
    Thanks,
    Jackie

    I have questions about this table 'DR$FND_LOBS_CTX$I'
    1. What's the purpose of this table?There is no description about this table in MOS or eTRM -- http://etrm.oracle.com/pls/et1211d9/etrm_pnav.show_object?c_name=DR$FND_LOBS_CTX$I&c_owner=APPLSYS&c_type=TABLE
    You may also check the code in $FND_TOP/sql/aflobbld.sql
    2. Can we purge this table? How?
    3. Is there any harmful if purge this table?Please see these docs/links.
    FND_LOBS_CTX Is Having Huge Size, How To Reduce The Size Of The Index [ID 396803.1]
    http://oracle-apps-dba.blogspot.com/2008/07/how-to-enable-fndhelp-search-by.html
    If you could not find complete answers to your questions, I would suggest you log a SR.
    Thanks,
    Hussein

  • Simple question about table structure and HR in BW

    i need to following data from HR:
    current FTE, employee number, cost place
    i dont think the current FTE is stored per employee. Therefor is would need a list that contains:
    mutation start date, mutation end date, FTE, employee, cost place
    i think cost place is a custom field.
    my question : what tables names and field names do i need?
    Thanks in advanced

    Hi,
    For Head Count you can use 0HR_PA_0 datasource and the other Employee details like start date and end date you can get them from employee master data and FTE can be calculated from the Emloyee Master Data and Head count data.
    Hope this helps...
    Thanks,

  • Please advice about table partitioning

    Hi.
    I need some advice on table partitioning. Here is the problem : My application procesess 7 types of documents (all like invoices). I have created master/detail tables for each type of document. But the are no big difrences between documents, so I was planing to move all of this document types to one master and one detail table and use table partitioning based od document type. This would to simplifay my programming very much... but I am not sure how will this effect on application performance ??? We process a large number of documents (over 300 a day).
    So what do you think ?

    1) If you are using the standard edition, partitioning is not an option. Partitioning is an extra-cost licensing option that is only available to enterprise edition customers.
    2) I am having a bit of difficulty reconciling the numbers you are providing with your descriptions. An application that inserts 5 MB of data a day and adds fewer than 2 million rows per year is a pretty small database, particularly to consider partitioning for. 50 active users doesn't seem terribly large. It is far from obvious to me that separate schemas by year provides any sort of benefit overall. OLTP operations should be able to use appropriate indexes to avoid all the read-only data. And a single schema with a single set of tables minimizes the number of hard parses you have to do, the number of queries that have to be rewritten every year to go after new schemas of data, etc
    Justin

  • Question about Table Locks

    Hi All,
    Is there any Oracle defined table/place from where we can know the details about Tables that have been locked in the current session?
    Thank you.

    Hi ,
    To know which all objects are locked, you can use the below query :-
    COLUMN owner FORMAT A20
    COLUMN username FORMAT A20
    COLUMN object_owner FORMAT A20
    COLUMN object_name FORMAT A30
    COLUMN locked_mode FORMAT A15
    SELECT b.session_id AS sid,
           NVL(b.oracle_username, '(oracle)') AS username,
           a.owner AS object_owner,
           a.object_name,
           Decode(b.locked_mode, 0, 'None',
                                 1, 'Null (NULL)',
                                 2, 'Row-S (SS)',
                                 3, 'Row-X (SX)',
                                 4, 'Share (S)',
                                 5, 'S/Row-X (SSX)',
                                 6, 'Exclusive (X)',
                                 b.locked_mode) locked_mode,
           b.os_user_name
    FROM   dba_objects a,
           v$locked_object b
    WHERE  a.object_id = b.object_id
    ORDER BY 1, 2, 3, 4;Anand

  • Satellite A200 - Question about HDD partitions and RAM

    This may be in the wrong section... I don't know.
    I've never owned an OEM OS and I also don't understand why the HDD comes partitioned 90, 2, 90 (who thought of that?).
    The thing is that I have to format and partition differently (since I have to dual boot Linux) and need to create a structure more like 40,40,100 or such. (100 being fat32 so data can be accessed for both)
    Now I'm just wondering which data I should be keeping from these drives. There's a folder called Toshiba on the C:\ drive which seems to have drivers and such, a few wallpapers and who knows what else. Then there's the D: drive called WinRE which has some sort of sdi and wim files.
    Another question, if I buy the 2GB which is listed in the compatible options for my laptop (A200-28P)
    Link: [http://uk.computers.toshiba-europe.com/innovation/jsp/individualOptions.do?service=UK&OPTION_ID=138301&t oshibaShop=true&selCategory=4700]
    Will it match the 2GB already in the laptop? Will it void the warranty in any way?

    Yes, I am using Vista, sorry, I forgot to mention that. The drive however is definately not hidden (it's clearly visible as the D drive and labelled WinRE).
    I'm not an idiot. I understand it, but you have got to admit that giving the OS 90 is a bit extreme and obviously I know what I can do with the other 90.
    I'd also like to point something out:
    "It's always advisable to partition an large HDD in more partition. This improves the performance because OS can access the files much faster."
    This is more than just an urban myth, it is down right stupid to believe that. After all, the data has a physical position on the drive and partitioning doesn't change the fact that it still has to get the needle to point to the location where the data is located on the drive.
    The needle still travels the same distance as referred to by the MFT.
    The question is if I can alter the partitions when using the strange Toshiba recovery disk. Afterall OEMs don't come with standard install disks and seem to limit your options.
    Again regarding the ram, I know the laptop can run 4 gigs, but I want to know whether the 2GB stick I'd buy from Toshiba would be the exact same as the one already installed, as in same timings and such.
    So in conclusion the data on D is worthless. What about the stuff in the Toshiba folder? And sorry if I sound condescending or like an *insert disallowed word here*, I'm just not in the best mood right now (serious data loss on my project because of a Uni server crash!).

  • A few questions about managing partitions when performing a recovery

    Hello everybody,
    I purchased an L505-13Z about to weeks ago for personal use and light audio editing work. In these two weeks I took the time to explore and test this computer's performance and found it suitable for my needs, as it withstands even havier audio work then I will need, as tested. I am really happy with this laptop! Anyway, few optimizations I did for the audio software have wiped some needed features of the computer, so I needed to install the OS again.. Basically, I was always used to have the system install only wiping the system drive, leaving the "D:Data" partition intact. I notice this isn't the case with system recovery, as after recovery, both system and data partitions were wiped. of course everything is backed up on an external drive, but every time I perform a recovery I will need to copy everything back from the backup drive? I missed the point of this - it's exactly like having all my data saved on the system partition.. What's the need for the data partition then?
    Is there a way to perform a recovery and leave the "Data" partition untouched?
    My second question is if it's possible to change the size of the partitions somehow? I think that it's a bit useless to have 230G of free space for the system partition. For my needs, 100G is enough, and I could use the remaining 130G for the Data partition, I don't know why the drive is just split in half by default... (I am aware that a partition size change must wipe ALL data on the drive).
    Thanks everybody in advance for any help!

    If you use HDD recovery procedure - http://aps2.toshiba-tro.de/kb0/HTD9102IR0000R01.htm - the structure and data on second partition will not be deleted.
    So, if you want to install OS using HDD recovery option you can move all important data from partition C to partition D.
    The whole HDD will be deleted if you use recovery DVDs for OS installation.
    You should not change partitions structure because it can have negative influence on further HDD recovery procedure. It can happen that recovering data will not be found anymore.
    Please note: second partition D is not some kind of recovery or system partition. It is normal and usual HDD partition. There is just saved Toshiba recovery image in folder called HDDRecovery.
    Best thing you can do, I done it too, is to enter properties for this folder and define it as invisible.
    You will not be irritated with this folder. It is there but you cannot see it and there is no way you can delete it somehow. Use this partition as usual. Create own folders, copy data there, simply do your usual work.
    More questions?

  • Two 'blunt' questions on Table Partitioning ?

    Version: 10.2, 11.2
    I wasn't fortunate enough to work in Partitioning in my DBA career. So , I have 2 basic questions.
    Question1.
    What is the most common form of partitioning you have come across ?
    Question2.
    Generally, would you prefer creating a global index or a local index for a partitioned table ?
    I mean: Global Index for particular type of partitioning or a particular column data type...etc

    >
    I wasn't fortunate enough to work in Partitioning in my DBA career. So , I have 2 basic questions.
    Question1.
    What is the most common form of partitioning you have come across ?
    Question2.
    Generally, would you prefer creating a global index or a local index for a partitioned table ?
    I mean: Global Index for particular type of partitioning or a particular column data type...etc
    >
    Sounds like interview questions to me. What answers to you give to those questions?
    If you are new to partitioning I suggest you review the entire VLDB and Partitioning Guide
    http://docs.oracle.com/cd/B28359_01/server.111/b32024/toc.htm
    That doc covers all aspects of partitioning including the different types of partitioning and types of indexes and when to use each of them.
    Partitioning should only be used when it solves a demonstrated problem that can't be solved using traditional techniques.
    Common forms are RANGE, LIST, HASH, and composites of those. REF partitioning is also used as needed.
    The type of index to use depends on the data and the reason partitioning was used to begin with. Global indexes can degrade the performance of partition maintenance.

  • Question about Tables in iWeb

    Having read previous posts, I understand that tables can be made one of two ways for use in iWeb: (1) Create them in Pages or Keynote and paste them in or (2) create HTML code and use the HTML snippit widget.
    The problem I see with the first method is that the table, based upon my experimentation, are seen in iWeb as a graphic. So there's no real way to control something like print size, for instance.
    The problem with the second method is that an HTML snippit cannot be inserted within a textbox. So if a person's browser is rending text differently than I have set up a page in iWeb, text could potentially overlap the table.
    Therefore, to put a table in the middle of text, it would seem preferable to create the table in Pages or Keynote.
    So here's my question, assuming the above is correct--is there any way for a table pasted from Pages or Keynote to be treated as any other way than a graphic? I'm still concerned about text size in the graphic not matching text size on the page with all the various browsers and browser settings. I realize that this method won't create overlapping text, but it would seem that there's great potential for the table to not match the body text.

    I know that iWeb creates them in HTML. I am a little more familiar with web pages than what I my post probably let you believe. I guess what I was curious about was the way in which Apple archives the news and turns it into an RSS feed. I've tried playing around with Safari, and viewing other RSS feeds, but I have not come across a way to print multiple RSS feeds at once.
    I guess what I am trying to get around is printing all of the pages individually, since as you could imagine that would equate to a ton of paper since I would be working about 3-4 days per week x 32 weeks (8 months). So you are talking about 96-128 pages of entries.
    Could you recommend any shortcuts for trying to do what I am trying to do, even if it doesn't involve iWeb? (I do have access to another domain with PHP scripting and a mySQL database if you have suggestions)

  • Creating SAP QUERY - question about tables in buisness transactions.

    Hello.
    I am pretty new to SAP.
    I want to create a query, as i so far have successfully done by creating a join in transaction SQVI.
    I am useing several tables;
    CRMD_ORDERADM_H
    CRMD_ORDERADM_I
    CRMD_ORDER_INDEX
    I have two questions.
    1: I try to join CRMD_ORDER_INDEX-PARTNER_NO with BUT000-PARTNER, but it won't do the trick. After a join like this i would like to join BUT000 with ADRC . Can someone explain how i could do this?
    2: I want join CRMD_ORDERADM_I with all the partners for the specific Item. (sold-to-party, shipping-party and so on). Can anyone tell me which table(s) i can find this in, and what fields to join.
    I will appreciate any answer to this

    Hi,
    For the second question, enter your transaction number ( Object ID ) into <b>CRMD_ORDERADM_H</b>  table. Pass the guid to table <b>CRMD_LINK.</b>
    Take set guid from CRMD_LINK and pass it to <b>CRMD_PARTNER</b>.
    You will get all the partners in that transaction
    regards,
    Prashant
    <b>Kindly Reward the points if helpful !</b>

  • Question about table strucuture

    Hello Gurus,
           I have following two questions:
        (1) how can I know what is the key field for a table ?
        (2) in SE80, when I display the structure of a table, there are component type and data type , why does here have two different types? ( apparently, there values are differenct)
    thanks very much!

    Hi,
        1) Go to t.code 'SE11'
            enter the table name and display.
             there the key checkbox is enabled.this the primary key field.
            If the checkbox is not enabled then it is a non key field.
      2) In structure,
             Component type refers the data element.
              Datatype refers type of the field that is wheather it is char,int etc.,
    Thank u,
    Manjula Devi.D

  • Question about multiple partitions.

    Hi guys Yesterday I got my MacBook Pro 13”. This is my first Mac. So I’ve some few questions. If anybody answer those, then it’ll be very helpful to me.
    It’s come with Snow Leopard on one single partition.
    From my previous experience, I’ve learnt that, OS and personal data put in a single partition is not a good idea. If I need to clean install the OS then I’ve to format the full partition and then my other data will be lost. So it’s better to have separate partitions, if I’ll have to format the OS partition then others partition and their data will be intact.
    So is it ok to have few partitions on OS-X? Like C: D: E: in Windows?
    My hard disk is 250GB so I’ve plane to divide it into 3 parts. 1st one is for OS. 2nd one and 3rd one are for others staff. So I have to do it while I clean install the OS. What file format should I use for them? Do I have to mount them to specific name?

    adnansanni wrote:
    It’s come with Snow Leopard on one single partition.
    From my previous experience, I’ve learnt that, OS and personal data put in a single partition is not a good idea. If I need to clean install the OS then I’ve >to format the full partition and then my other data will be lost.
    I would not "waste" a partition to have my data on it. There probably are better uses for partitions. Above, the suggestion was made to have a good system backup. I agree. I would clone my internal volume to a partition on an external drive to accomplish this result. You can use Disk Utility, Carbon Copy Cloner, or SuperDuper, for example, to clone.
    So it’s better to have separate partitions, if I’ll have to format the OS partition then others partition and their data will be intact.
    As indicated, I don't think that doing so is better. But, I don't understand the rest of what you say above.
    So is it ok to have few partitions on OS-X? Like C: D: E: in Windows?
    Definitely yes. I would plan carefully what partitions I will need at this point. For example, would you also want to run Leopard on a partition? And, as mentioned above, would would want to run Windows on a partition? I run Sno, Leopard, and Win7 on separate partitions on my internal. There are ways of getting around the two partition "standard" with Windows on the second partition.
    At this point, you probably will not need to erase and install to add several partitions. But, you will need to plan carefully if using Disk Utility to partition.
    My hard disk is 250GB so I’ve plane to divide it into 3 parts. 1st one is for OS. 2nd one and 3rd one are for others staff. So I have to do it while I clean install the OS. What file format should I use for them? Do I have to mount them >to specific name?
    As mentioned, at this point, you probably won't need to erase and install, but you need to decide, for sure, how many partitions you want and what sizes you want them to be if you want to do the partitioning with Disk Utility.

Maybe you are looking for