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
Merge requests
!33
[BW]: fixes to found bugs
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
[BW]: fixes to found bugs
root_title_fix
into
develop
Overview
1
Commits
2
Pipelines
0
Changes
6
Merged
Bartek Wrona
requested to merge
root_title_fix
into
develop
4 years ago
Overview
1
Commits
2
Pipelines
0
Changes
1
Expand
defined vw_hive_posts to simplify queries and eliminate joins at query side
fixed fatal bug in special characters escaping leading to modification of post body, title etc
fixed bug in querying for root_title in condnser_api/tags_api get_comment_discussions_by method family
fixed bug in querying for post url
eliminated unneeded fields in _condenser_post_object causing returning not needed additional data
tags_api group enabled in 5M smokest
0
0
Merge request reports
Compare
version 1
version 1
11cda7cc
4 years ago
develop (base)
and
latest version
latest version
33a78df2
2 commits,
4 years ago
version 1
11cda7cc
1 commit,
4 years ago
Show latest version
1 file
+
1
−
1
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
hive/db/schema.py
+
62
−
0
Options
@@ -584,6 +584,68 @@ def setup(db):
"""
db
.
query_no_return
(
sql
)
sql
=
"""
DROP VIEW IF EXISTS public.vw_hive_posts;
CREATE OR REPLACE VIEW public.vw_hive_posts
AS
SELECT hp.id,
hp.community_id,
ha_a.name AS author,
hpd_p.permlink,
hpd.title,
hpd.body,
hcd.category,
hp.depth,
hp.promoted,
hp.payout,
hp.payout_at,
hp.is_paidout,
hp.children,
0 AS votes,
0 AS active_votes,
hp.created_at,
hp.updated_at,
hp.rshares,
hpd.json,
hp.is_hidden,
hp.is_grayed,
hp.total_votes,
hp.flag_weight,
ha_pa.name AS parent_author,
hpd_pp.permlink AS parent_permlink,
hp.curator_payout_value,
ha_ra.name AS root_author,
hpd_rp.permlink AS root_permlink,
rcd.category as root_category,
hp.max_accepted_payout,
hp.percent_hbd,
hp.allow_replies,
hp.allow_votes,
hp.allow_curation_rewards,
hp.beneficiaries,
concat(
'
/
'
, rcd.category,
'
/@
'
, ha_ra.name,
'
/
'
, hpd_rp.permlink,
case (rp.id)
when hp.id then
''
else concat(
'
#@
'
, ha_a.name,
'
/
'
, hpd_p.permlink)
end ) as url,
rpd.title AS root_title
FROM hive_posts hp
JOIN hive_posts rp ON rp.author_id = hp.root_author_id AND rp.permlink_id = hp.root_permlink_id
JOIN hive_post_data rpd ON rp.id = rpd.id
JOIN hive_accounts ha_a ON ha_a.id = hp.author_id
JOIN hive_permlink_data hpd_p ON hpd_p.id = hp.permlink_id
JOIN hive_post_data hpd ON hpd.id = hp.id
LEFT JOIN hive_category_data hcd ON hcd.id = hp.category_id
LEFT JOIN hive_category_data rcd ON rcd.id = rp.category_id
JOIN hive_accounts ha_pa ON ha_pa.id = hp.parent_author_id
JOIN hive_permlink_data hpd_pp ON hpd_pp.id = hp.parent_permlink_id
JOIN hive_accounts ha_ra ON ha_ra.id = hp.root_author_id
JOIN hive_permlink_data hpd_rp ON hpd_rp.id = hp.root_permlink_id;
;
"""
db
.
query_no_return
(
sql
)
def
reset_autovac
(
db
):
"""
Initializes/resets per-table autovacuum/autoanalyze params.
Loading