Merge pull request #284 from CartoDB/analysis-quota-factor
Analysis quota factor
This commit is contained in:
@@ -21,7 +21,7 @@ BEGIN
|
|||||||
factor := _CDB_GetConfAnalysisQuotaFactor();
|
factor := _CDB_GetConfAnalysisQuotaFactor();
|
||||||
-- With a default value
|
-- With a default value
|
||||||
IF factor IS NULL THEN
|
IF factor IS NULL THEN
|
||||||
factor := 0.2;
|
factor := 2;
|
||||||
END IF;
|
END IF;
|
||||||
RETURN factor;
|
RETURN factor;
|
||||||
END;
|
END;
|
||||||
@@ -39,7 +39,7 @@ $$
|
|||||||
DECLARE
|
DECLARE
|
||||||
schema_name TEXT;
|
schema_name TEXT;
|
||||||
user_name TEXT;
|
user_name TEXT;
|
||||||
qmax int8;
|
nominal_quota int8;
|
||||||
cache_size float8;
|
cache_size float8;
|
||||||
BEGIN
|
BEGIN
|
||||||
-- We rely on the search_path to determine the user's schema and
|
-- 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.
|
-- At the moment we're not using the provided table_name.
|
||||||
|
|
||||||
SELECT current_schema() INTO schema_name;
|
SELECT current_schema() INTO schema_name;
|
||||||
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO qmax;
|
EXECUTE FORMAT('SELECT %I._CDB_UserQuotaInBytes();', schema_name) INTO nominal_quota;
|
||||||
IF qmax*_CDB_AnalysisQuotaFactor() < _CDB_AnalysisDataSize(schema_name) THEN
|
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
|
-- The limit is defined by a factor applied to the total space quota for the user
|
||||||
RAISE EXCEPTION 'Analysis cache space limits exceeded';
|
RAISE EXCEPTION 'Analysis cache space limits exceeded';
|
||||||
END IF;
|
END IF;
|
||||||
|
|||||||
Reference in New Issue
Block a user