Skip to content

Commit d8ebd04

Browse files
authored
fix: create row history entries in batches to avoid memory spikes (baserow#5251)
1 parent afe29a2 commit d8ebd04

2 files changed

Lines changed: 12 additions & 1 deletion

File tree

backend/src/baserow/contrib/database/rows/history.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,9 @@ def record_history_from_rows_action(
3737
row_history_entries = row_history_provider.get_row_history(user, action)
3838

3939
if row_history_entries:
40-
row_history_entries = RowHistory.objects.bulk_create(row_history_entries)
40+
row_history_entries = RowHistory.objects.bulk_create(
41+
row_history_entries, batch_size=1000
42+
)
4143
for table_id, per_table_row_history_entries in groupby(
4244
row_history_entries, lambda e: e.table_id
4345
):
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"type": "bug",
3+
"message": "Create row history entries in batches to avoid memory spikes",
4+
"issue_origin": "github",
5+
"issue_number": null,
6+
"domain": "database",
7+
"bullet_points": [],
8+
"created_at": "2026-04-22"
9+
}

0 commit comments

Comments
 (0)