Skip to content
Snippets Groups Projects

bridge_api.get_account_posts "by comment" optimization.

Merged Bartek Wrona requested to merge bw_bridge_get_account_posts_by_comments_opt into develop
1 file
+ 8
3
Compare changes
  • Side-by-side
  • Inline
@@ -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
Loading