 
  How to expose a property as a database column
 How to expose a property as a database column03-02 C-285 KARAF PRPC stores the values of all aggregate properties and some Single Value properties in a BLOB column (the Storage Stream), usually in a compressed form. Such properties cannot support selection in list view and summary view reports, and can slow retrieval and processing in other operations.
For maximum flexibility, your development team can create new Single Value properties at any time, without the need to coordinate with a database administrator. However, exposing properties as distinct columns can significantly improve performance. You can expose a property even after the property has values, but additional processing is required to copy values for the new column from the BLOB value into the new column.
To make changes to the database schema, your connection to the PegaRULES database must allow certain SQL capabilities. See the notes on Admin Username fields on the topic Database form — Completing the Database tab.
Single Value, top-level properties to expose in a development system
             The Column Inclusion field (on the Advanced tab of the Property form, for
The Column Inclusion field (on the Advanced tab of the Property form, for Single Value properties) contains one of four values (blank, Optional, Required, Requested) that indicates the judgement or opinion of the developer who created or updated the property. This value is advisory only; it does not affect any runtime behavior of the property. However, using the Database Class Mappings gadget, you can compare the values in this field with the current schema, identifying properties marked as Required which are not exposed.  > Data Model > Classes and Properties > Database Class Mappings to access this gadget.
> Data Model > Classes and Properties > Database Class Mappings to access this gadget.
The Property Optimization tool is available only on development systems — systems where the production level is 1 or 2.
Select  > System > Database > Column Population Jobs to monitor the background processing.
> System > Database > Column Population Jobs to monitor the background processing.
Computations involving the property may produce unpredictable or inconsistent results until the background processing is complete.
Use the Modify Schema wizard to:
single value property as a new column.Select  > System > Database > Modify Schema to start the wizard. Click the help button (
> System > Database > Modify Schema to start the wizard. Click the help button ( ) on each form of the wizard for additional details on completing the form.
) on each form of the wizard for additional details on completing the form.
You can use this facility to copy a single value property from the BLOB column and "expose" it as a column. This change may affect database performance and database size, but has no functional effect on activities, the property, or other rules referencing the property.
             To modify a table schema with this facility, work at a time when no one else is using the table. Obtain a database user ID and password that allow you to modify the database schema, not just the rows in the database. (If your account does not provide the ability to modify the schema, you can generate the Data Description Language (DDL) statements that are required to modify the schema.)
To modify a table schema with this facility, work at a time when no one else is using the table. Obtain a database user ID and password that allow you to modify the database schema, not just the rows in the database. (If your account does not provide the ability to modify the schema, you can generate the Data Description Language (DDL) statements that are required to modify the schema.)
             When working offline, you can review the contents of the database schema as initially installed. Locate and open the schema HTM file in the Resource Kit directory of the PRPC installation media.
When working offline, you can review the contents of the database schema as initially installed. Locate and open the schema HTM file in the Resource Kit directory of the PRPC installation media.
 > System > Database > Modify Schema. This opens the Modify Schema wizard.
> System > Database > Modify Schema. This opens the Modify Schema wizard.Single Value properties in the class that are marked as Required in the Column Inclusion field on the Advanced tab on the property form. Values in this field are advisory only; they do not affect database operation. SR-7205 B-25362 BUG-701 incompleteRequired or Recommended).Text, Identifier, or Password, you can modify the column width shown in the Column/Size column. The default width is 64 characters, or the Max Length of the property (if that was defined for the property). If you change these values, remember to update later the Max Length values if defined on the Property form.To create columns using SQL:
If, in the Storage Stream (BLOB) column, the selected property or properties has non-blank values for at least some rows, you must extract (copy) the existing values into the new column. Use the Column Populator utility. See Working with the PegaRULES database — Using the Column Populator utility.
Only top-level Single Value properties can be exposed as columns. Two tactics are available when you need a database column that contains the value of an embedded property:
Copy approach — Copy the value to a new top-level property each time the embedded property changes (or each time the instance containing the property is saved). For example, if a list view report needs to select rows based on property pyWorkPage.pxFlow("LoanDisburse").Sheet.Detail(4), you can:
Single Value property to hold a copy of this value.Trigger.Declare Index approach — If not one but many or all values of a Value List or Value Group are needed as exposed columns, a Declare Index rule is a better approach.
Single Value properties in the new class to hold values of the embedded values. Don't confuse an exposed property with an indexed database column. For example, the property Work-.pyID is an exposed property in the table
Don't confuse an exposed property with an indexed database column. For example, the property Work-.pyID is an exposed property in the table pc_work. However, if this table contains millions of rows, one for each work item, a list view search for .pyID of "W-135" causes an expensive database table scan. Creating database indexes or PRPC indexes can speed database operations in such situations. PEPEN 9/15/06 CLINIC
 Exposing too many properties in a table may speed reporting and searching operations, but make insert and update operations slower. The tradeoff and relative impact depends on hardware and software and no general guidelines can be stated.
Exposing too many properties in a table may speed reporting and searching operations, but make insert and update operations slower. The tradeoff and relative impact depends on hardware and software and no general guidelines can be stated.