Questions tagged [materialized-view]
Defined like a view but holding persistent data like a table, Materialized Views are a feature of a number of RDBMSs including Oracle, DB2 and postgres. SQL Server has a similar feature called an Indexed View that is considered similar enough to come under this tag.
290 questions
1 vote
2 answers
303 views
Efficient approach for filtering, paging and sorting across multiple tables with multiple key columns
I have a query that retrieves data from a complex data structure involving multiple tables. The data can be filtered using a tree component that allows selection of different keys from different ...
1 vote
1 answer
77 views
Refreshing a PostgreSQL materialised view and returning the rowcount
Immediately after refreshing a materialised view in Postgres I'd like to know how many rows are in it. Currently I do this by running a 2nd SQL command (SELECT count(*) FROM...) Is there a more ...
0 votes
1 answer
109 views
What is the best way to handle materialized views with different timezones?
I am building some API endpoints backed by materialized views (I am using Ruby on Rails). The data is from Quake Live and it basically contains game stats (weapon accuracy, damage dealt, etc). I want ...
2 votes
1 answer
145 views
Does Postgres materialized view refresh view concurrently continue after client disconnect?
I have a materialize view that I update using REFRESH MATERIALIZED VIEW CONCURRENTLY my_view using a Kubernetes cronjob that runs every 15 minutes. I'm experiencing a problem where it seems there are ...
0 votes
0 answers
315 views
Columns With No Statistics warning quering indexed view WITH (NOEXPAND)
I am querying the indexed view with aggregate function WITH(NOEXPAND) hint. SELECT MIN(Column) FROM dbo.vwi_indexed_view WITH(NOEXPAND); I am getting Columns With No Statistics warning inside the ...
2 votes
1 answer
329 views
Views in Postgresql replica
At work we're thinking about adding a Postgresql replica. We were wondering whether it's possible to create views and materialised views directly on the replica.
0 votes
1 answer
267 views
Sharding a Materialized View
I am a Postgres 15.3 AWS RDS instance and have a database that centers around one table, called posts that has 20 other relations to build the full object. The full query is about a second altogether ...
1 vote
0 answers
94 views
Continious aggregates (keeping aggregated data in a fresh state) for PostgreSQL
I build a PostgreSQL database for movie db platform. This DB is heavy loaded for readings of many related data. Here is simplified schema what I have: create table items ( id ...