Using a Transformation to Horizontally Partition a Table
When a table is extremely large and you need to query some of the rows more often than the rest, you can apply a transformation and horizontally partition a table. When you horizontally partition a table, you divide the rows in a table across several smaller tables. Normally, you horizontally partition a table to:
- Improve query performance. When an application passes a SQL SELECT statement to the DBMS, the database retrieves a specific set of records from a smaller table.
- Manage tables more easily. The partitioned data is stored in several smaller tables. Therefore, it is easier to load and delete data in the partitioned tables than in the large table.
- Perform better backup and recovery operations. The partitioned tables are smaller than the source table. Therefore, you can have more options for backing up and recovering the partitioned tables than for a single large table.
Before you horizontally partition a table, you need to identify the queries used most frequently.
Horizontal Partitioning Wizard
To horizontally partition a table, select a single table in a model, and click the Horizontal Partition icon on the Transformations toolbar. Use the Horizontal Partitioning Wizard to:
- Specify how many partitioned tables to create.
- Enter a name for the partitioned tables.
- Enter, for notational purposes only, criteria for how you place rows from the table you choose to partition into the new partitions. You can enter a script (SQL SELECT statement) and store the text for annotation purposes.
Result of Horizontally Partitioning a Table
When you click Horizontal Partition to horizontally partition a table, you:
- Create a new table for each partition that you specify. Each partitioned table contains all primary key and non-key columns from the source table. The primary key of each partitioned table is the primary key of the source table. The partitioned tables appear in the Model Explorer under the Tables folder.
- Create all relationships associated with the source table that you horizontally partition, and preserves all migrating keys.
- Preserve the properties from the source columns. The properties from the source table are not preserved.
Important! Once you apply the Horizontal Partition transformation, it cannot be reversed. While in the current modeling session however, you can undo the action.
Copyright © 2023 Quest Software, Inc. |