Skip to content
Snippets Groups Projects
Commit b9058cd6 authored by Bartek Wrona's avatar Bartek Wrona
Browse files

Merge branch 'mi_too_many_follows_notifications' into 'develop'

issue #99: From follows only 'follow blog' events generate notifications

See merge request !372
parents 03bbcd76 80ef5db1
No related branches found
No related tags found
2 merge requests!456Release candidate v1 24,!372issue #99: From follows only 'follow blog' events generate notifications
......@@ -25,7 +25,7 @@ FROM
, rank() OVER(order by ha3.reputation DESC) as rank
FROM hive_accounts ha3
ORDER BY ha3.reputation DESC LIMIT 150000
-- Conditions above (related to rank.position) eliminates all records having rank > 100k. So with inclding some
-- Conditions above (related to rank.position) eliminates all records having rank > 100k. So with inclding some
-- additional space for redundant accounts (having same reputation) lets assume we're limiting it to 150k
-- As another reason, it can be pointed that only 2% of account has the same reputations, it means only 2000
-- in 100000, but we get 150000 as 50% would repeat
......@@ -130,7 +130,7 @@ UNION ALL
''::character varying(16) AS community,
''::character varying AS community_title,
''::character varying AS payload
FROM hive_follows hf
FROM hive_follows hf WHERE hf.state = 1 --only follow blog
UNION ALL
SELECT hr.block_num,
notification_id(hr.block_num, 14, hr.id) AS id,
......
......@@ -166,6 +166,7 @@ values
,(now(), '1f23e1326f3010bc84353aba82d4aa7ff2f999e4') -- hive_posts_author_id_created_at_idx index def. to speedup hive_accounts_info_view.
,(now(), '2a274e586454968a4f298a855a7e60394ed90bde') -- get_number_of_unread_notifications speedup https://gitlab.syncad.com/hive/hivemind/-/merge_requests/348/diffs
,(now(), '431fdaead7dcd69e4d2a45e7ce8a3186b8075515') -- https://gitlab.syncad.com/hive/hivemind/-/merge_requests/367
,(now(), 'cc7bb174d40fe1a0e2221d5d7e1c332c344dca34') -- https://gitlab.syncad.com/hive/hivemind/-/merge_requests/372
) ds (patch_date, patch_revision)
where not exists (select null from hive_db_patch_level hpl where hpl.patched_to_revision = ds.patch_revision);
......
......@@ -302,6 +302,12 @@ select 'update_hive_posts_children_count execution'
where not exists (select null from hive_db_patch_level where patched_to_revision = '0e3c8700659d98b45f1f7146dc46a195f905fc2d' )
;
-- https://gitlab.syncad.com/hive/hivemind/-/merge_requests/372
INSERT INTO hive_db_data_migration
select 'Notification cache initial fill'
where not exists (select null from hive_db_patch_level where patched_to_revision = 'cc7bb174d40fe1a0e2221d5d7e1c332c344dca34' )
;
--- 1847c75702384c7e34c624fc91f24d2ef20df91d latest version of develop included in this migration script.
--- Rename hive_votes_ux1 unique constraint to the hive_votes_voter_id_author_id_permlink_id_uk
......@@ -322,12 +328,6 @@ CREATE INDEX IF NOT EXISTS hive_posts_author_id_created_at_idx ON public.hive_po
CREATE INDEX IF NOT EXISTS hive_blocks_created_at_idx ON hive_blocks (created_at);
INSERT INTO hive_db_data_migration
SELECT 'Notification cache initial fill'
WHERE NOT EXISTS (SELECT data_type
FROM information_schema.columns
WHERE table_name = 'hive_notification_cache');
--- Notification cache to significantly speedup notification APIs.
CREATE TABLE IF NOT EXISTS hive_notification_cache
(
......
Subproject commit c50665c8f66121db558caa7c205631c28e0fe2ed
Subproject commit c9a3f6ecc01e3bed1098bf9698e95002ccdd47d6
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