Follow-up from "Mi vote noitifcations payload speedup"

The following discussion from !322 (merged) should be addressed:

  • @bwrona started a discussion:

    We should be sure that block_before_head is called just once, not for every processed record. Maybe better is to explicitly put result into variable, and next use this one in the WHERE condition.

Edited by Bartek Wrona