Skip to content
Snippets Groups Projects
Commit d990332b authored by Bartek Wrona's avatar Bartek Wrona Committed by Dan Notestein
Browse files

One of hive_follows indexes extended by `id` column to eliminate HEAP sort...

One of hive_follows indexes extended by `id` column to eliminate HEAP sort while calling condenser_get_followers
parent 23627048
No related branches found
No related tags found
2 merge requests!827Merge develop changes to master,!686One of hive_follows indexes extended by `id` column to eliminate HEAP sort...
...@@ -115,7 +115,7 @@ class DbState: ...@@ -115,7 +115,7 @@ class DbState:
'hive_feed_cache_created_at_idx', 'hive_feed_cache_created_at_idx',
'hive_feed_cache_post_id_idx', 'hive_feed_cache_post_id_idx',
'hive_feed_cache_account_id_created_at_post_id_idx', 'hive_feed_cache_account_id_created_at_post_id_idx',
'hive_follows_following_state_idx', # (following, state, created_at, follower) 'hive_follows_following_state_id_idx', # (following, state, id)
'hive_follows_follower_state_idx', # (follower, state, created_at, following) 'hive_follows_follower_state_idx', # (follower, state, created_at, following)
'hive_follows_follower_following_state_idx', 'hive_follows_follower_following_state_idx',
'hive_follows_block_num_idx', 'hive_follows_block_num_idx',
......
...@@ -288,7 +288,7 @@ def build_metadata(): ...@@ -288,7 +288,7 @@ def build_metadata():
sa.Column('follow_muted', BOOLEAN, nullable=False, server_default='0'), sa.Column('follow_muted', BOOLEAN, nullable=False, server_default='0'),
sa.Column('block_num', sa.Integer, nullable=False), sa.Column('block_num', sa.Integer, nullable=False),
sa.UniqueConstraint('following', 'follower', name='hive_follows_ux1'), # core sa.UniqueConstraint('following', 'follower', name='hive_follows_ux1'), # core
sa.Index('hive_follows_following_state_idx', 'following', 'state'), sa.Index('hive_follows_following_state_id_idx', 'following', 'state', 'id'), # index used by condenser_get_followers
sa.Index('hive_follows_follower_state_idx', 'follower', 'state'), sa.Index('hive_follows_follower_state_idx', 'follower', 'state'),
sa.Index('hive_follows_follower_following_state_idx', 'follower', 'following', 'state'), sa.Index('hive_follows_follower_following_state_idx', 'follower', 'following', 'state'),
sa.Index('hive_follows_block_num_idx', 'block_num'), sa.Index('hive_follows_block_num_idx', 'block_num'),
......
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