Hellen Jiang <hjiang@xxxxxxxxxxxxxxxxxxxxx> writes: > When the materialized view was refreshing concurrently, I saw the pg_lock like this: there was no response within 30 seconds when the api calls this query, and we got api time out. Well, that seems to confirm my idea that the REFRESH is blocked behind somebody else's lock. But you need to look to see which session is holding a lock on mvw_cbsd_status_grants_lessinfo_active_softmarker and what it's doing. regards, tom lane