Skip to content
Snippets Groups Projects
Commit ff407712 authored by Michal Zander's avatar Michal Zander
Browse files

Remove hardcoded schema name from vacuum

parent 3fd6de97
No related branches found
No related tags found
1 merge request!89Rewrite calculate_account_reputations
Pipeline #116059 passed
......@@ -70,6 +70,28 @@ CREATE TABLE IF NOT EXISTS active_votes
PERFORM hive.app_register_table( __schema_name, 'active_votes', __schema_name );
EXECUTE format(
$BODY$
CREATE OR REPLACE PROCEDURE %I.reptracker_process_blocks(_context_name hive.context_name, _block_range hive.blocks_range, _logs BOOLEAN = true)
LANGUAGE 'plpgsql'
AS
$pb$
BEGIN
IF hive.get_current_stage_name(_context_name) = 'MASSIVE_PROCESSING' THEN
CALL reptracker_massive_processing(_block_range.first_block, _block_range.last_block, _logs);
PERFORM hive.app_request_table_vacuum('%s.account_reputations', interval '10 minutes');
PERFORM hive.app_request_table_vacuum('%s.active_votes', interval '10 minutes');
PERFORM hive.app_request_table_vacuum('%s.permlinks', interval '100 minutes');
RETURN;
END IF;
CALL reptracker_single_processing(_block_range.first_block, _block_range.last_block, _logs);
END
$pb$
$BODY$, __schema_name, __schema_name, __schema_name, __schema_name);
END
$$;
......
......@@ -61,24 +61,6 @@ END IF;
END
$$;
CREATE OR REPLACE PROCEDURE reptracker_process_blocks(_context_name hive.context_name, _block_range hive.blocks_range, _logs BOOLEAN = true)
LANGUAGE 'plpgsql'
AS
$$
BEGIN
IF hive.get_current_stage_name(_context_name) = 'MASSIVE_PROCESSING' THEN
CALL reptracker_massive_processing(_block_range.first_block, _block_range.last_block, _logs);
PERFORM hive.app_request_table_vacuum('reptracker_app.account_reputations', interval '10 minutes'); --eventually fixup hard-coded schema name
PERFORM hive.app_request_table_vacuum('reptracker_app.active_votes', interval '10 minutes'); --eventually fixup hard-coded schema nam
PERFORM hive.app_request_table_vacuum('reptracker_app.permlinks', interval '10 minutes'); --eventually fixup hard-coded schema name
RETURN;
END IF;
CALL reptracker_single_processing(_block_range.first_block, _block_range.last_block, _logs);
END
$$;
CREATE OR REPLACE FUNCTION do_rep_indexes_exist()
RETURNS BOOLEAN
LANGUAGE 'plpgsql' VOLATILE
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment