| Actor | Fragment | Worker | State |
|---|---|---|---|
| 99951 | 22222 | 26 | running |
| 99952 | 22222 | 26 | running |
| 99953 | 22223 | 26 | running |
| 99954 | 22223 | 26 | running |
CREATE MATERIALIZED VIEW search.party_active_relationships_mv AS
SELECT
party_id,
type,
status
FROM (
SELECT
party_id,
type,
status,
ROW_NUMBER() OVER (
PARTITION BY party_id, type
ORDER BY updated_at DESC, status_changed_at DESC, effective_from DESC, id DESC
) AS rn
FROM party.customer_relationships AS customer_relationships_next
WHERE
disabled_at IS NULL
) AS deduped
WHERE
rn = 1