> Documentation index: https://www.gooddata.ai/docs/gooddata-ui/llms.txt lists every page of these docs as Markdown.

# Sample data to speed up executions

> Speed up visualizations by processing a percentage of dataset rows using the execConfig dataSamplingPercentage option.

API reference: [IExecutionConfig](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iexecutionconfig/index.md) (interface), [InsightView()](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-ext/sdk-ui-ext.insightview/index.md) (function)

Use data sampling to check a visualization quickly: the backend processes only a percentage of the rows in the fact datasets instead of all of them. For how sampling works in GoodData, see [Data sampling](https://www.gooddata.ai/docs/cloud/create-visualizations/visualization-properties/#data-sampling) in the GoodData Cloud docs.

> **Vertica only:**
> Data sampling works only in workspaces that use a Vertica data source without table views.

## [Sample the data of a visualization](https://www.gooddata.ai/docs/gooddata-ui/latest/data-layer/execution/data-sampling/#sample-the-data-of-a-visualization)

Pass `dataSamplingPercentage` in the `execConfig` prop. The value is a percentage of the available rows, so `5` runs the execution on five percent of the data:

```tsx
import { InsightView } from "@gooddata/sdk-ui-ext";

export const SampledVisualization = () => (
    <InsightView
        insight="<visualization-id>"
        execConfig={{ dataSamplingPercentage: 5 }}
    />
);
```

Smaller values return faster but give rougher aggregates; larger values are closer to the real numbers but take longer.

## [Notes](https://www.gooddata.ai/docs/gooddata-ui/latest/data-layer/execution/data-sampling/#notes)

- `execConfig` is an [`IExecutionConfig`](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-model/sdk-model.iexecutionconfig/index.md) object, so you can combine `dataSamplingPercentage` with other execution options, such as a time zone or a date format.
- Sampling changes only the execution on the backend. Loading, error handling, and drilling of [`InsightView`](https://www.gooddata.ai/docs/gooddata-ui/latest/api-reference/sdk-ui-ext/sdk-ui-ext.insightview/index.md) work the same.
- The results are approximate. Don't sample executions behind exports or numbers your users rely on, and remove the option before you ship a dashboard to production.
