diff --git a/hive/db/sql_scripts/bridge_get_account_posts_by_comments.sql b/hive/db/sql_scripts/bridge_get_account_posts_by_comments.sql index 708730e436ab40d3d41c386e1454071f6e8f77e1..bd02c77323b61ad646ff5d3af1a866ae1f629120 100644 --- a/hive/db/sql_scripts/bridge_get_account_posts_by_comments.sql +++ b/hive/db/sql_scripts/bridge_get_account_posts_by_comments.sql @@ -48,9 +48,14 @@ BEGIN hp.is_pinned, hp.curator_payout_value FROM - hive_posts_view hp - WHERE - hp.author_id = __account_id AND hp.depth > 0 AND ( __post_id = 0 OR hp.id < __post_id ) + ( + SELECT hp1.id + FROM hive_posts hp1 + WHERE hp1.author_id = __account_id AND hp1.counter_deleted = 0 AND hp1.depth > 0 AND ( __post_id = 0 OR hp1.id < __post_id ) + ORDER BY hp1.id DESC + LIMIT _limit + ) ds + JOIN hive_posts_view hp ON ds.id = hp.id ORDER BY hp.id DESC LIMIT _limit; END