Skip to content
Snippets Groups Projects

add MATERIALIZED keyword to ring-fence some CTEs (i.e. WITH blocks)

Merged Bartek Wrona requested to merge postgres12_optimization into develop
Files
9
@@ -23,9 +23,18 @@ CREATE TABLE IF NOT EXISTS hive_db_vacuum_needed
TRUNCATE TABLE hive_db_vacuum_needed;
DO $$
DECLARE
__version INT;
BEGIN
SELECT CURRENT_SETTING('server_version_num')::INT INTO __version;
EXECUTE 'ALTER DATABASE '||current_database()||' SET join_collapse_limit TO 16';
EXECUTE 'ALTER DATABASE '||current_database()||' SET from_collapse_limit TO 16';
IF __version >= 120000 THEN
RAISE NOTICE 'Disabling a JIT optimization on the current database level...';
EXECUTE 'ALTER DATABASE '||current_database()||' SET jit TO False';
END IF;
END
$$;
Loading