postgres materialized view - ghdrako/doc_snipets GitHub Wiki

create materialized view transcripts as
    select
        students.name,
        students.type,
        courses.title,
        courses.code,
        grades.result
    from grades
    left join students on grades.student_id = students.id
    left join courses on grades.course_id = courses.id;

refresh materialized view transcripts; # Only the owner can then refresh mv