Review CTE SQL expressions and supplement top ones with MATERIALIZE keyword
PSQL 12 introduced different evaluation scheme of CTE expressions. To conform the intent, all CTEs followed by LATERAL JOIN of hivemind_app.get_post_view_by_id
should be supplemented with MATERIALIZED
keyword.
Additionally, each SQL statement performing main query, should be followed with comment holding name of function containing it, similary to:
Please target changes to regular develop branch, to make them compatible to both: regular and HAF driven version.
Edited by Bartek Wrona