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

Is there a plan to support trino metabase model cache? #56

Open
ydpzg opened this issue Nov 11, 2022 · 6 comments
Open

Is there a plan to support trino metabase model cache? #56

ydpzg opened this issue Nov 11, 2022 · 6 comments

Comments

@ydpzg
Copy link

ydpzg commented Nov 11, 2022

No description provided.

@leniartek
Copy link

Hi @ydpzg thanks for the question.
We will investigate the effort on our side and get back to you.

Can you elaborate more on your use case, performance and what change you expect with the model cahce?

Regards

@andrewdibiasio6
Copy link
Member

Here are the docs for modeling caching: https://www.metabase.com/docs/latest/data-modeling/models.html#model-caching

@Maiquu
Copy link
Contributor

Maiquu commented Nov 30, 2022

Implementation of model caching of postgres driver can be found at: https://github.com/metabase/metabase/blob/master/src/metabase/driver/postgres/ddl.clj

I wrote a very primitive implementation of model caching for the starburst driver. Due to my lack of clojure knowledge, most of the code is extracted from the postgres implementation. Since trino does not support all DDL statements in transactions, I removed the transaction wrappers and I haven't added rollbacks so beware. Source

Keep in mind that model caching uses CREATE TABLE AS and its not supported in all connectors. Its currently supported at following connectors.

EDIT: Forgot loading the ddl implementation in driver at the time I posted this. Should be fixed now.

@leniartek
Copy link

Thanks @Maiquu!
We will work on model cache in 2023, I will share more details when we have more concrete ETA.

@mir1198yusuf
Copy link

My use case is :
Data source 1 is postgres database
Data source 2 is postgres database

Both are production databases but I need to join data between two in same query for analytics.
I can do that with Trino.
I am using Metabase.
I want to save the query result for some hours. Save anywhere except in data sources 1 and 2. Metabase does this, it stores model cache in source db only which in turn again increases load on source db.

So if I can store the result of query in database 3 and Metabase always hit that database3 is ideal thing for me.
Load on database 3 is not an issue.

Can this be possible ?

@splashvarun
Copy link

Currently using Trino on metabase, we have to select one data source as Metabase supports only 2 level hierarchy of databases and tables. If we can allow the capability to use mysql or postgres as the default option in the metabase, then use the model cache that Metabase connectors of those models support, it can solve this issue.

That means, on all trino (starburst) connector, select a metadata datasource which will be used internally by metabase to cache model. Then we write the native sql to query other production datasources that are configured in trino itself.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants