 GRANT SELECT ON TABLE entity_tag._new_links_in_staging TO minerva;
 
 
-CREATE OR REPLACE FUNCTION entity_tag.add_new_links()
+CREATE OR REPLACE FUNCTION entity_tag.add_new_links(add_limit integer)
 	RETURNS bigint
 AS $$
 	WITH t AS (
 		INSERT INTO directory.entitytaglink(entity_id, tag_id)
 		SELECT entity_id, tag_id
 		FROM entity_tag._new_links_in_staging
+        LIMIT $1
 		RETURNING *
 	)
 	SELECT count(*) FROM t;

BEGIN
	result.staged = entity_tag.transfer_to_staging(type_name);

    process_result = entity_tag.process_staged_links();

	result.tags_added = process_result.tags_added;
	result.links_added = process_result.links_added;

);


CREATE OR REPLACE FUNCTION entity_tag.update(type_name name, update_limit integer DEFAULT 50000)
	RETURNS entity_tag.update_result
AS $$
DECLARE
