diff --git a/hive/db/db_state.py b/hive/db/db_state.py index c13747d418229404bc759da9ff070777e26649ed..5c8f4c7a5a8582149d85d29abf7d7eec28afc850 100644 --- a/hive/db/db_state.py +++ b/hive/db/db_state.py @@ -574,6 +574,7 @@ WHERE table_schema = '{SCHEMA_NAME}' AND table_type = 'BASE TABLE' if is_initial_massive: cls.vacuum_tables_in_threads([ + f"{SCHEMA_NAME}.hive_posts", f"{SCHEMA_NAME}.hive_feed_cache", f"{SCHEMA_NAME}.hive_mentions", f"{SCHEMA_NAME}.hive_communities", diff --git a/hive/db/schema.py b/hive/db/schema.py index 69a4fa9d3a212e66400eca4f21274d26362e58a5..27ab72c82c0e0a5d468f55f2b4cf7925614579bc 100644 --- a/hive/db/schema.py +++ b/hive/db/schema.py @@ -734,10 +734,10 @@ def reset_autovac(db): per-table, in the format (autovacuum_threshold, autoanalyze_threshold).""" autovac_config = { # vacuum analyze -# 'hive_accounts': (50000, 100000), + 'hive_accounts': (50000, 100000), 'hive_posts': (2500, 10000), 'hive_post_tags': (5000, 10000), -# 'hive_follows': (5000, 5000), + 'hive_follows': (5000, 5000), # 'hive_feed_cache': (5000, 5000), # 'hive_reblogs': (5000, 5000), } @@ -753,9 +753,10 @@ ALTER TABLE {SCHEMA_NAME}.{table} SET (autovacuum_vacuum_scale_factor = 0, def set_fillfactor(db): - """Initializes/resets FILLFACTOR for tables which are intesively updated""" + """Initializes/resets FILLFACTOR for tables which are intensively updated""" - fillfactor_config = {'hive_posts': 90, 'hive_post_data': 100, 'hive_votes': 100} + # Lowered fillfactor for hive_votes table in attempt to speed up update_posts_rshares procedure + fillfactor_config = { 'hive_posts': 90, 'hive_post_data': 100, 'hive_votes': 90 } for table, fillfactor in fillfactor_config.items(): sql = f"ALTER TABLE {SCHEMA_NAME}.{table} SET (FILLFACTOR = {fillfactor});"