readthedocs.org
cd4535e1 - DB: do not fetch `data` and others when deleting rows (#10446)

Commit
2 years ago
DB: do not fetch `data` and others when deleting rows (#10446) * DB: do not fetch `data` and others when deleting rows This task was cancelled again. The query shows a SELECT first that fetchs the whole rows. I think we can reduce this time/memory by only fetching the ids. * DB: only fetch "id" when deleting rows * DB: clean up old data using raw SQL from Django We are facing an issue with this query because it takes too long to execute (more than 30s) making our DB to kill the query. This is because Django performs a `SELECT` first to be able to trigger pre_ and post_ delete signals on each object delete. We don't really need this here, so we are using raw SQL to bypass this and make the query to execute faster. This is not ideal, but we didn't find a better approach. * DB: there is no results to fetch The query is executed without requiring `.fetchall()`
Author
Parents
Loading