본문 바로가기
TIL

postgresql - REFRESH MATERIALIZED VIEW

by hojin880214 2022. 5. 20.
REFRESH MATERIALIZED VIEW name
    [ WITH [ NO ] DATA ]

Parameters

CONCURRENTLY

Refresh the materialized view without locking out concurrent selects on the materialized view. Without this option a refresh which affects a lot of rows will tend to use fewer resources and complete more quickly, but could block other connections which are trying to read from the materialized view. This option may be faster in cases where a small number of rows are affected.

This option is only allowed if there is at least one UNIQUE index on the materialized view which uses only column names and includes all rows; that is, it must not be an expression index or include a WHERE clause.

This option may not be used when the materialized view is not already populated.

Even with this option only one REFRESH at a time may run against any one materialized view.

 

 

materialized view 갱신

 

REFRESH MATERIALIZED VIEW CONCURRENTLY table_name WITH NO DATA;

 

 

CONCURRENTLY 갱신하면서 기존 데이터 조회가 가능하게 해줌

 

'TIL' 카테고리의 다른 글

postgresql - relispopulated  (0) 2022.05.20
es module  (0) 2022.05.18

댓글