Skip to content

Count rows for view #12791

Answered by bobbyiliev
devopg asked this question in Q&A
May 31, 2022 · 3 comments · 2 replies
Discussion options

You must be logged in to vote

Hi there,

It looks like that the market_orders view is not materialized. You can verify this with the following query:

SHOW FULL VIEWS;

You can almost think the NON-materialized views as a reusable template to be used in other materialized views. The NON-materialized views do not actually process any data.

What you can do is create a materialized view with the following:

CREATE MATERIALIZED VIEW market_orders_count AS SELECT count(*) FROM public.market_orders;

The above will create a materialized view called market_orders_count which will contain the result of your query and the results will be incrementally updated as the data changes.

For more information on materialized views and how t…

Replies: 3 comments 2 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by devopg
Comment options

You must be logged in to vote
1 reply
@bobbyiliev
Comment options

Comment options

You must be logged in to vote
1 reply
@bobbyiliev
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants