From 64fae71a371d8a571417681af79c26156664edd5 Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Wed, 19 Oct 2016 12:36:55 +0200 Subject: [PATCH 1/2] Default factor for analysis size from 0.2 to 2 Change the default value for the factor of analysis tables size from 0.2 to 2. I also checked it is applied on the "nominal" user quota. --- scripts-available/CDB_AnalysisCheck.sql | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts-available/CDB_AnalysisCheck.sql b/scripts-available/CDB_AnalysisCheck.sql index c8dddf3..7ad076f 100644 --- a/scripts-available/CDB_AnalysisCheck.sql +++ b/scripts-available/CDB_AnalysisCheck.sql @@ -21,7 +21,7 @@ BEGIN factor := _CDB_GetConfAnalysisQuotaFactor(); -- With a default value IF factor IS NULL THEN - factor := 0.2; + factor := 2; END IF; RETURN factor; END; From bc5e23b14319027f9e34fe62da28b9941b22318d Mon Sep 17 00:00:00 2001 From: Rafa de la Torre Date: Wed, 19 Oct 2016 12:41:18 +0200 Subject: [PATCH 2/2] Replace `qmax` by `nominal_quota` Since the analysis quota factor can be greater than 1, `qmax` can be a misleading name. Thus the change in var name. --- scripts-available/CDB_AnalysisCheck.sql | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts-available/CDB_AnalysisCheck.sql b/scripts-available/CDB_AnalysisCheck.sql index 7ad076f..1aab236 100644 --- a/scripts-available/CDB_AnalysisCheck.sql +++ b/scripts-available/CDB_AnalysisCheck.sql @@ -39,7 +39,7 @@ $$ DECLARE schema_name TEXT; user_name TEXT; - qmax int8; + nominal_quota int8; cache_size float8; BEGIN -- We rely on the search_path to determine the user's schema and @@ -53,8 +53,8 @@ BEGIN -- At the moment we're not using the provided table_name. SELECT current_schema() INTO schema_name; - EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO qmax; - IF qmax*_CDB_AnalysisQuotaFactor() < _CDB_AnalysisDataSize(schema_name) THEN + EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO nominal_quota; + IF nominal_quota*_CDB_AnalysisQuotaFactor() < _CDB_AnalysisDataSize(schema_name) THEN -- The limit is defined by a factor applied to the total space quota for the user RAISE EXCEPTION 'Analysis cache space limits exceeded'; END IF;