Comment 3 for bug 1189808

Revision history for this message
Daniel Holbach (dholbach) wrote :

Maybe we could do something like this (pseudo-code):

bulk_insert = []
for row in cursor.fetchall():
    if row.index % 1000:
        Uploads.objects.bulk_create(bulk_insert)
    else:
        bulk_insert.append(row)

If the cursor.fetchall() cakk is actually problematic, we would need to slice the database results.

Not sure if the above isn't actually confusing. :-)