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

hivemind_app_block_view switched to hive.blocks_view due to peformance...

hivemind_app_block_view switched to hive.blocks_view due to peformance reasons. Postgres again is ignoring index, while perfoming order by query over indexed column, in case of complex view.
parent a18b7de7
No related branches found
No related tags found
2 merge requests!584Changes to be delivered to master as 1.27 release,!558Merge develop-haf with current develop
......@@ -36,7 +36,7 @@ BEGIN
--- Warning given account can have no last_read_at set, so lets fallback to the block limit to avoid comparison to NULL.
SELECT COALESCE((SELECT hb.num
FROM hive.hivemind_app_blocks_view hb
FROM hive.blocks_view hb -- very important for performance (originally it was a hivemind_app_blocks_view)
WHERE hb.created_at <= __last_read_at
ORDER by hb.created_at desc
LIMIT 1), __limit_block)
......
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