diff --git a/hive/indexer/blocks.py b/hive/indexer/blocks.py
index ceb9c3e5fdf68d6fb2a7b35bac85473582051d3a..6579accbbfc6edee2f5c53a572a1edcda4388d00 100644
--- a/hive/indexer/blocks.py
+++ b/hive/indexer/blocks.py
@@ -238,7 +238,7 @@ class Blocks:
 
         if vote_ops is not None:
           for k, v in vote_ops.items():
-              Votes.effective_comment_vote_op(k, v, cls._head_block_date)
+            Votes.effective_comment_vote_op(k, v)
 
         if Posts.comment_payout_ops:
             cls.ops_stats = Blocks.merge_ops_stats(cls.ops_stats, comment_payout_stats)
diff --git a/hive/indexer/votes.py b/hive/indexer/votes.py
index 312b0820cc2afe5260dd2b04b1131d0c0c583219..628e0385fc5c8cb3e5df69f3aa601539bec91463 100644
--- a/hive/indexer/votes.py
+++ b/hive/indexer/votes.py
@@ -62,16 +62,21 @@ class Votes:
 
         key = voter + "/" + author + "/" + permlink
 
-        cls._votes_data[key] = dict(voter=voter,
-                                    author=author,
-                                    permlink=permlink,
-                                    vote_percent=weight,
-                                    weight=0,
-                                    rshares=0,
-                                    last_update=date)
+        if key in cls._votes_data:
+            cls._votes_data[key]["vote_percent"]=weight
+            cls._votes_data[key]["last_update"]=date
+        else:
+            cls._votes_data[key] = dict(voter=voter,
+                                        author=author,
+                                        permlink=permlink,
+                                        vote_percent=weight,
+                                        weight=0,
+                                        rshares=0,
+                                        last_update=date,
+                                        is_effective=False)
 
     @classmethod
-    def effective_comment_vote_op(cls, key, vop, date):
+    def effective_comment_vote_op(cls, key, vop):
         """ Process effective_comment_vote_operation """
 
         if(cls.inside_flush):
@@ -80,9 +85,9 @@ class Votes:
 
         assert key in cls._votes_data
 
-        cls._votes_data[key]["weight"]        = vop["weight"]
-        cls._votes_data[key]["rshares"]       = vop["rshares"]
-        cls._votes_data[key]["last_update"]   = date
+        cls._votes_data[key]["weight"]       = vop["weight"]
+        cls._votes_data[key]["rshares"]      = vop["rshares"]
+        cls._votes_data[key]["is_effective"] = True
 
     @classmethod
     def flush(cls):
@@ -106,32 +111,49 @@ class Votes:
                 ON CONFLICT ON CONSTRAINT hive_votes_ux1 DO
                 UPDATE
                   SET
-                    weight = (CASE (SELECT hp.is_paidout FROM hive_posts hp WHERE hp.id = EXCLUDED.post_id) WHEN true THEN hive_votes.weight ELSE EXCLUDED.weight END),
-                    rshares = (CASE (SELECT hp.is_paidout FROM hive_posts hp WHERE hp.id = EXCLUDED.post_id) WHEN true THEN hive_votes.rshares ELSE EXCLUDED.rshares END),
+                    weight = {}.weight,
+                    rshares = {}.rshares,
                     vote_percent = EXCLUDED.vote_percent,
                     last_update = EXCLUDED.last_update,
                     num_changes = hive_votes.num_changes + 1
                   WHERE hive_votes.voter_id = EXCLUDED.voter_id and hive_votes.author_id = EXCLUDED.author_id and hive_votes.permlink_id = EXCLUDED.permlink_id;
                 """
+            # WHERE clause above seems superfluous (and works all the same without it, at least up to 5mln)
 
-            values = []
+            values_skip = []
+            values_override = []
             values_limit = 1000
 
             for _, vd in cls._votes_data.items():
+                values = None
+                on_conflict_data_source = None
+
+                if vd['is_effective']:
+                    values = values_override
+                    on_conflict_data_source = 'EXCLUDED'
+                else:
+                    values = values_skip
+                    on_conflict_data_source = 'hive_votes'
+
                 values.append("('{}', '{}', '{}', {}, {}, {}, '{}'::timestamp)".format(
                     vd['voter'], vd['author'], vd['permlink'], vd['weight'], vd['rshares'], vd['vote_percent'], vd['last_update']))
 
                 if len(values) >= values_limit:
                     values_str = ','.join(values)
-                    actual_query = sql.format(values_str)
+                    actual_query = sql.format(values_str,on_conflict_data_source,on_conflict_data_source)
                     DB.query(actual_query)
                     values.clear()
 
-            if len(values) > 0:
-                values_str = ','.join(values)
-                actual_query = sql.format(values_str)
+            if len(values_skip) > 0:
+                values_str = ','.join(values_skip)
+                actual_query = sql.format(values_str,'hive_votes','hive_votes')
+                DB.query(actual_query)
+                values_skip.clear()
+            if len(values_override) > 0:
+                values_str = ','.join(values_override)
+                actual_query = sql.format(values_str,'EXCLUDED','EXCLUDED')
                 DB.query(actual_query)
-                values.clear()
+                values_override.clear()
 
             cls._votes_data.clear()
         cls.inside_flush = False
diff --git a/tests/tests_api b/tests/tests_api
index 619f51ed6c85a016621b12fa1264c12c7d3d3156..dfd353231403e3613f0a5e1bdcbdca7a8d4f42fa 160000
--- a/tests/tests_api
+++ b/tests/tests_api
@@ -1 +1 @@
-Subproject commit 619f51ed6c85a016621b12fa1264c12c7d3d3156
+Subproject commit dfd353231403e3613f0a5e1bdcbdca7a8d4f42fa