Skip to content
Snippets Groups Projects
Commit f92eac4d authored by Mariusz Trela's avatar Mariusz Trela
Browse files

Execution of `delete_hive_posts_mentions` function is accelerated

parent 10d70b96
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!314mentions fix
......@@ -6,18 +6,13 @@ LANGUAGE 'plpgsql'
AS
$function$
DECLARE
__head_block_time TIMESTAMP;
__90_days_beyond_head_block_number INTEGER;
BEGIN
__head_block_time = head_block_time();
__90_days_beyond_head_block_number = block_before_head('90 days'::interval);
DELETE FROM hive_mentions hm
WHERE post_id in
(
SELECT id
FROM hive_posts
WHERE created_at < ( __head_block_time - '90 days'::interval )
);
DELETE FROM hive_mentions
WHERE block_num < __90_days_beyond_head_block_number;
END
$function$
......
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