Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
H
hivemind
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
hivemind
Commits
f92eac4d
Commit
f92eac4d
authored
4 years ago
by
Mariusz Trela
Browse files
Options
Downloads
Patches
Plain Diff
Execution of `delete_hive_posts_mentions` function is accelerated
parent
10d70b96
No related branches found
No related tags found
2 merge requests
!456
Release candidate v1 24
,
!314
mentions fix
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
hive/db/sql_scripts/delete_hive_posts_mentions.sql
+4
-9
4 additions, 9 deletions
hive/db/sql_scripts/delete_hive_posts_mentions.sql
with
4 additions
and
9 deletions
hive/db/sql_scripts/delete_hive_posts_mentions.sql
+
4
−
9
View file @
f92eac4d
...
...
@@ -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
$
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment