Skip to content
GitLab
Explore
Sign in
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
Merge requests
!282
Optimization of notification_apis:
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Optimization of notification_apis:
notification_optimizations
into
develop
Overview
0
Commits
4
Pipelines
0
Changes
1
Merged
Bartek Wrona
requested to merge
notification_optimizations
into
develop
4 years ago
Overview
0
Commits
4
Pipelines
0
Changes
1
Expand
introduced reduced notification view, providing raw account and post IDs to eliminate joins to big tables before actual filtering
updated notification API functions to use faster view.
0
0
Merge request reports
Viewing commit
355e3233
Prev
Next
Show latest version
1 file
+
21
−
0
Side-by-side
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
355e3233
Added missing file.
· 355e3233
Bartek Wrona
authored
4 years ago
hive/db/sql_scripts/hive_posts_base_view.sql
0 → 100644
+
21
−
0
Options
DROP
VIEW
if
exists
public
.
hive_posts_base_view
cascade
;
CREATE
OR
REPLACE
VIEW
public
.
hive_posts_base_view
AS
SELECT
hp
.
block_num
,
hp
.
id
,
hp
.
author_id
,
hp
.
permlink_id
,
hp
.
payout
,
hp
.
pending_payout
,
COALESCE
((
SELECT
sum
(
CASE
v
.
rshares
>=
0
WHEN
true
THEN
v
.
rshares
ELSE
-
v
.
rshares
END
)
AS
sum
FROM
hive_votes
v
WHERE
v
.
post_id
=
hp
.
id
AND
NOT
v
.
rshares
=
0
GROUP
BY
v
.
post_id
),
0
::
numeric
)
AS
abs_rshares
FROM
hive_posts
hp
;
Loading