Sample data to speed up executions
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 in the GoodData Cloud docs.
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:
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
execConfigis anIExecutionConfigobject, so you can combinedataSamplingPercentagewith 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
InsightViewwork 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.
Related
Render any saved GoodData visualization by reference with the InsightView component.
Configure backend response caching with withCaching, including execution result expiration, cache limits, and the recommended defaults.
Build custom executions with attributes, measures, filters, sorting, and dimensions via the Analytical Backend fluent API.
Create, inspect, and modify execution attributes, filters, measures, and sort items with SDK model factories, builders, and accessors.