Skip indexes and Refreshing views

Skip indexes and Refreshing views make the Warehouse tables behind a model cheaper to read. A skip index lets the database skip the parts of a table that a chart's filters prove empty, without storing or changing anything. A Refreshing view stores its rows and rebuilds them on a schedule, so charts read data as of the last refresh instead of re-running the view's query. Both are early steps of the performance ladder.

Add a skip index

Ask the Warehouse Builder in its chat to add one, for example "add an index on Ship Date". During a build, the Model Builder adds them itself as the first ladder step for slow charts. The change arrives in the chat as an index card; the card's layout is shown in Warehouse tool cards.

Defaults and rules

Estimate an index before it is written

On newer database engines you can estimate an index before building it: the estimate reports how many granules each candidate would let the table skip, against representative queries with the slow charts' filters. Ask for it in the Warehouse Builder chat.

Turn a Standard view into a Refreshing view

A Refreshing view stores its rows and refreshes them on a schedule. Create one from the start in the Warehouse by choosing the view type Refreshing (its refresh settings are on Views), or convert an existing Standard view by asking the Warehouse Builder in its chat.

Refresh schedules

Questions, answered

What does a skip index actually do?

It tells the database which parts of a table a filter can skip, so a chart reads less. It stores no rows and changes nothing in the table.

Can I change an index's type or granularity later?

No. An index's type and granularity cannot be updated, and existing indexes are never changed. Create a new index with what you want; the old one stays as it is.

Why is minmax refused on some columns?

Because the column is a LowCardinality(Nullable) column: a minmax index there can make IS NULL filters return no rows. Use set or bloom_filter on that column instead.

Why does the index card say "Not needed: the table is empty"?

The table holds no rows yet, so there is nothing for the index to cover. It covers every part the next load writes.

What does "Writing for the loaded data..." mean?

The index is being written for the rows the table already holds, in the background. When it finishes, the card reads Written for the loaded data in n s; measure the charts again after that.

Can I estimate an index before it is written?

Yes, on a newer database engine. One estimate prices 1 to 6 candidate indexes against up to 5 one-table queries and builds nothing, and a Model Builder will not write an index over loaded data that was not estimated first. The estimates are kept for the session.

Why does the estimate say "Not recorded: createTableIndex will ask for it again"?

The estimate was not stored for this Model Builder session, so writing that index will ask for an estimate again. Run the estimate again to record it.

What is a Refreshing view?

A view that stores its query's rows as a table and rebuilds them on a schedule. Charts on it read data as of the last refresh instead of re-running the query.

Why does a converted view return no rows?

Its first refresh has not finished yet. On older engines a converted view returns no rows until that refresh completes; on newer engines readers keep the Standard view until the stored table is filled, so they never see the gap.

Who can change or stop a refresh schedule?

A person, in the Warehouse UI: open the view's Settings tab. The Model Builder only schedules what it converts, at most once a day, and never starts, stops or cancels a schedule.

Can the Model Builder convert a view that existed before the design?

No. It converts only the design's own views, and adds indexes only on the design's fact and dimension tables. A change to a table that existed before the design comes to you first as a shared-table question; see Full-history backfill and the performance ladder.