Execution time of materialzed view and materialized table

Who takes the more time materialized table or materialized view? How can I show it?

{{ config(materialized=‘view’) }}

SELECT
country_code,
country_size
FROM
{{ref(‘country_details’)}}
how can i show it using this query for view and table? Please answer it

The “view” materialization will almost always be faster because views do not store any data. But there are situations where the “table” (or other) materializations can perform better overall, depending on the sorts of queries issued against your model.

There’s a terrific overview in the documentation here: https://docs.getdbt.com/docs/build/materializations

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.

If you were using backend database as snowflake then you can check who takes more time there in Query History tab. All querys you execute on dbt at the end they hits to snowflake so you can check there. It stores the details long to 7 days prior to that you can check the query details.

I am using postgres as database,So I want to have clarity that
Is materialised view in postgres is different from materialised view in dbt?

As u said view do not stores data ,But in materialised view of postgres data is stored that is why execution is faster in materialised view of postgres as it does not run the query again and again.
Am I missing something ?

@akashsolanke22 can u address this?

As far as I know, dbt does not yet support the creation or maintenance of materialized views (but that functionality is planned for a future release). I cannot speak to to the performance characteristics of dbt’s “table” materialization vs an equivalent Postgres materialized view.

Note: @Owen originally posted this reply in Slack. It might not have transferred perfectly.