Performance
Closed this issue · 5 comments
I tried to use this, but I find the performance very insuficient for my case. I want to cache chart values in django-admin-charts
, but if I cache daily values for a few years, this bulk update will run for tens of seconds.
In comparison Django's bulk_create
runs only about a second.
So in my case I found it better to delete all the old values and create the new ones with bulk_create
.
Thanks for the feedback. Not entirely sure what is the ask though as not familiar with that package nor what calls you doing.
if calling delete and bulk_create is an option for you, it should be faster indeed.
this is meant to “update” and I guess that comes at a cost.
Closing for lack of details
I just wanted to point out, that there are big reserves in performance over bulk_create and that users should know, that in some cases there are quicker ways to go.
Indeed, thanks for that. Though not sure how that would fit in the docs as this is for “update_or_create” which “delete and create” is definitely not the same (triggers, cascade deletions, auto PK changes, etc)
You are absolutely right.
I don't have to care much about any of this, because I am not working with primary data. And the performance is the primary concern for this case.
Hope that at least somebody would find this discussion, if he is in similar case to mine.