diff --git a/hive/db/schema.py b/hive/db/schema.py
index 8017b60f9474166c52f17c9cbe132850a2dea9c9..b12d3dc11818dec671ab5cd9cf12bbad57bc5085 100644
--- a/hive/db/schema.py
+++ b/hive/db/schema.py
@@ -1016,6 +1016,16 @@ def setup(db):
     """
     db.query_no_return(sql)
 
+    sql = """
+          DO $$
+          BEGIN
+            EXECUTE 'ALTER DATABASE '||current_database()||' SET join_collapse_limit TO 16';
+            EXECUTE 'ALTER DATABASE '||current_database()||' SET from_collapse_limit TO 16';
+          END
+          $$;
+          """
+    db.query_no_return(sql)
+
 def reset_autovac(db):
     """Initializes/resets per-table autovacuum/autoanalyze params.