Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Extract Rollup Designer + detail backup in data model generator #8026

Merged
merged 2 commits into from
Mar 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/pages/product/workspace/_meta.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
module.exports = {
"playground": "Playground",
"data-model": "Data Model",
"rollup-designer": "Rollup Designer",
"dev-mode": "Development mode",
"semantic-layer-sync": "Semantic Layer Sync",
"sql-runner": "SQL Runner",
Expand Down
34 changes: 27 additions & 7 deletions docs/pages/product/workspace/data-model.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -120,20 +120,40 @@ want to delete, then open the switcher and click <Btn>Remove Branch</Btn>:
alt="Delete a branch"
/>

## Generating models
## Generating data model files

Cube Cloud supports generating models from a data source after the initial
deployment creation. The <Btn>Generate Data Model</Btn> on the <Btn>Data
Model</Btn> page will let you re-generate models from your source database, or
alternatively add rollups to existing data models:
You can generate data model files when [creating a new
deployment][ref-creating-deployment] or at later moment. To open the data model
wizard, click on the <Btn>...</Btn> button on the right and select <Btn>Generate
data model</Btn>:

<Screenshot
src="https://ucarecdn.com/b83b8b21-7894-4363-9b0e-5f390b50cd6f/"
alt="Generate rollups or data model modal"
highlight="inset(17.5% 0 50% 80% round 10px)"
src="https://ucarecdn.com/0f9684c2-a7f5-48a2-9fac-32e050beba5d/"
/>

It is safe to generate data model files for tables that already have matching cubes.
In that case, existing files will be renamed by appending `.backup` to their names.
You would also be able to review changes to files on the <Btn>Changes</Btn> tab:

<Screenshot src="https://ucarecdn.com/a8d53348-8441-41f3-969c-df46d41d78b6/" />


## Creating pre-aggregations

If you'd like to use the UI to create a pre-aggregation, you can click on the
<Btn>...</Btn> button on the right and select <Btn>Add rollup</Btn> to open
[Rollup Designer][ref-rollup-designer]:

<Screenshot
highlight="inset(17.5% 0 50% 80% round 10px)"
src="https://ucarecdn.com/0f9684c2-a7f5-48a2-9fac-32e050beba5d/"
/>

[ref-data-modeling]: /product/data-modeling/overview
[ref-cubes]: /reference/data-model/cube
[ref-joins]: /reference/data-model/joins
[ref-join-types]: /reference/data-model/joins#relationship
[wiki-erd]: https://en.wikipedia.org/wiki/Entity–relationship_model
[ref-rollup-designer]: /product/workspace/rollup-designer
[ref-creating-deployment]: /product/deployment/cloud/deployments#creating-a-new-deployment
42 changes: 8 additions & 34 deletions docs/pages/product/workspace/playground.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -93,47 +93,21 @@ To see the SQL generated by a query, click <Btn>Generated SQL</Btn>:
If you're using Cube Cloud, you can copy this SQL and run it in your data source
using the [SQL Runner][ref-workspace-sqlrunner].

## Using the Rollup Designer
## Accelerating queries

The Rollup Designer provides an easy way to create and edit
[pre-aggregations][ref-caching-preaggs-gs] from within the Playground. For
example, when you execute a query that has no matching pre-aggregations, the
Playground also displays some information above the results:
When you execute a query that has no matching [pre-aggregations][ref-caching-preaggs-gs],
you would see this notificaton. Clicking on it will open [Rollup
Designer][ref-rollup-designer] that would help you create a pre-aggregation
to accelerate the query:

<Screenshot
highlight="inset(58% 16% 37% 49% round 10px)"
src="https://ucarecdn.com/4698a6c7-b77e-41ec-8866-3611d6a6e073/"
/>

Clicking <Btn>Query was not accelerated with pre-aggregation</Btn> will open the
Rollup Designer with a suggested pre-aggregation that will accelerate the query:

<Screenshot src="https://ucarecdn.com/d860dd55-4f94-46a1-ba64-53452ec267ba/" />

If desired, you can also modify settings such as the [refresh
key][ref-preaggs-ref-refreshkey], the [partition
granularity][ref-preaggs-ref-partitiongranularity], and
[indexes][ref-preaggs-ref-indexes] to further optimize the pre-aggregation by
clicking the ​<Btn>Settings</Btn> tab:

<Screenshot src="https://ucarecdn.com/27afed37-10ae-4948-bf3f-4261f6e0663c/" />

Click <Btn>Add to the Data Schema</Btn> to add the pre-aggregation to the data
model. You can then run the query again to see the results:

<Screenshot
highlight="inset(52% 15% 42% 52% round 10px)"
src="https://ucarecdn.com/e75a39a7-db3f-479f-a606-4680d04dd5d0/"
highlight="inset(22.5% 0 65% 72.5% round 10px)"
src="https://ucarecdn.com/582acb98-373b-4617-9aa8-263b0653cd00/"
/>

[cube-cloud]: https://cube.dev/cloud
[ref-dev-mode]: /product/configuration
[ref-devtools-ide]: /cloud/dev-tools/cube-ide
[ref-caching-preaggs-gs]: /product/caching/getting-started-pre-aggregations
[ref-preaggs-ref-refreshkey]:
/reference/data-model/pre-aggregations#refresh_key
[ref-preaggs-ref-partitiongranularity]:
/reference/data-model/pre-aggregations#partition_granularity
[ref-preaggs-ref-indexes]:
/reference/data-model/pre-aggregations#indexes
[ref-workspace-sqlrunner]: /product/workspace/sql-runner
[ref-rollup-designer]: /product/workspace/rollup-designer
65 changes: 65 additions & 0 deletions docs/pages/product/workspace/rollup-designer.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
# Rollup Designer

Rollup Designer provides an easy way to create and edit
[pre-aggregations][ref-caching-preaggs-gs].

<SuccessBox>

Rollup Designer is available in Cube Cloud on [all tiers](https://cube.dev/pricing).

</SuccessBox>

## Identifying slow queries

You can identify queries that might be accelerated with pre-aggregations in
[Playground][ref-playground] and [Query History][ref-query-history].

You can also access Rollup Designer from [Data Model][ref-data-model].

### Playground

When you execute a query in [Playground][ref-playground] that has no matching
pre-aggregations, you would see this notificaton. Clicking on it will open
Rollup Designer with a suggested pre-aggregation:

<Screenshot
highlight="inset(22.5% 0 65% 72.5% round 10px)"
src="https://ucarecdn.com/582acb98-373b-4617-9aa8-263b0653cd00/"
/>

### Query History

When you browse a query in [Query History][ref-query-history] that has no matching
pre-aggregations, you would see this notificaton. Clicking on <Btn>Accelerate</Btn>
will open Rollup Designer with a suggested pre-aggregation:

<Screenshot
highlight="inset(37.5% 0 37.5% 5% round 10px)"
src="https://ucarecdn.com/1105e459-66b5-440e-8ca1-53e93c912cb5/"
/>

## Creating pre-aggregations

When you open Rollup Designer from Playground or Query History, it will suggest
a pre-aggregation accelerating the query in question:

<Screenshot src="https://ucarecdn.com/d860dd55-4f94-46a1-ba64-53452ec267ba/" />

If desired, you can also modify settings such as the [refresh
key][ref-preaggs-ref-refreshkey], the [partition
granularity][ref-preaggs-ref-partitiongranularity], and
[indexes][ref-preaggs-ref-indexes] to further optimize the pre-aggregation by
clicking the ​<Btn>Settings</Btn> tab:

<Screenshot src="https://ucarecdn.com/27afed37-10ae-4948-bf3f-4261f6e0663c/" />

Click <Btn>Add to the Data Schema</Btn> to add the pre-aggregation to the data
model.

[ref-caching-preaggs-gs]: /product/caching/getting-started-pre-aggregations
[ref-preaggs-ref-refreshkey]: /reference/data-model/pre-aggregations#refresh_key
[ref-preaggs-ref-partitiongranularity]: /reference/data-model/pre-aggregations#partition_granularity
[ref-preaggs-ref-indexes]: /reference/data-model/pre-aggregations#indexes
[ref-playground]: /product/workspace/playground
[ref-query-history]: /product/workspace/query-history
[ref-data-model]: /product/workspace/data-model
Loading