# Incremental Behavior Build

Incremental Behavior Build is a Parent Segment option that shortens the build time of behavior tables. Instead of rebuilding every behavior table from its full history on each run, the build reprocesses only a recent range of data, called a data window.

Behavior tables grow every day, so a full rebuild takes longer as your data accumulates. When behavior processing is the longest step in your build, segments reflect new data later than you need. Use this feature when behavior processing is the bottleneck in your Parent Segment build.

This feature is in public beta. To enable it, contact customer support.

## What the feature changes

The feature applies only to behavior tables. The customers table and the activities table are not processed incrementally.

## How the data window works

Each run reprocesses a data window instead of every row in a behavior table. The window ends at the latest value of the `time` column in the source table, and it starts a set number of days earlier. You set the window length when you enable the feature. The supported range is 3 to 14 days, and 7 days is the recommended value.

Each window overlaps the previous one. A record that arrives late is picked up by the next run, as long as its `time` value falls inside the window. Records with a `time` value older than the window are not picked up by a regular run. To load them, run a full refresh, as described in [Run a full refresh after importing past data](#run-a-full-refresh-after-importing-past-data).

After a long pause between runs, the window also starts from the end of the previous window, so no time range is skipped. A run after a long pause can therefore process more data than the window length.

## How updates reach segments

During a run, the rows in the window are deleted and inserted again in a copy of the behavior table. Segment queries keep reading the previous copy until the update finishes. The switch to the updated copy happens at once, so segments never read a partially updated table.

## Requirements and limitations

Before you enable the feature, confirm the following for each behavior table:

- The table has a `time` column that holds the time of each event.
- Newly loaded rows have `time` values later than the rows that were already processed.
- Import of past data is complete. If you need to import more past data later, run a full refresh afterward.


The feature has the following limitations:

- Only behavior tables are supported.
- Direct SQL queries against a behavior table are not covered by this feature.


## Enable or disable the feature

Enabling the feature requires help from customer support. Send the following information to customer support:

- The URL of the target audience.
- The behavior tables that you want to apply the feature to, if you do not want it on all of them.
- The data window length, from 3 to 14 days. The recommended value is 7 days.


To stop using the feature, contact customer support with the URL of the target audience. After the change, the audience returns to full processing for all behavior tables.

## Run a full refresh after importing past data

If you import data older than the data window after you enable the feature, run a full refresh for the affected behavior table. A full refresh rebuilds the behavior table from all of its source data, so it takes longer than a regular run. Also run a full refresh when you update older rows, or when the source table's schema changes without a change to the audience definition.

Do not add this step to the system-generated workflow, because the entities that Parent Segments create must not be edited. Instead, create a new Treasure Workflow that calls the full refresh workflow with the `require>` operator:

```yaml
+full_refresh:
  require>: behavior_<SOURCE_BEHAVIOR_TABLE>_fullrefresh
  project_name: cdp_audience_<YOUR_AUDIENCE_ID>
```

Replace `<SOURCE_BEHAVIOR_TABLE>` with the name of your source behavior table, and replace `<YOUR_AUDIENCE_ID>` with the ID of your audience. Confirm the generated workflow name in your project before you run it.

## Related topics

* [Working With Parent Segments](/products/customer-data-platform/data-workbench/parent-segments)
* [Creating Parent Segments](/products/customer-data-platform/data-workbench/parent-segments/creating-parent-segments)
* [Refreshing Parent Segments](/products/customer-data-platform/data-workbench/parent-segments/refreshing-master-segments)
* [Viewing Parent Segment Workflow History](/products/customer-data-platform/data-workbench/parent-segments/viewing-master-segment-workflow-history)