On 01/10/2015 01:51 PM, Jonathan Vanasco wrote:
It's hard to tell what could cause the issue:

How many horses are there?
463827
What is going on in that other function?
Just a regex search, two selects and a commit
Are there foreign key checks involved with the commit?
Yep


When I set up the DB to log all queries, I can see the commit happening in less than a second. So I'm assured it's somewhere between my function and the DB.


If you want to break a huge batch into smaller commits, there is the `Windowed Range Query` strategy -- https://bitbucket.org/zzzeek/sqlalchemy/wiki/UsageRecipes/WindowedRangeQuery

That's kinda what I'm doing right now, but it just seems so hacky. I'd like to find a solution for the problem. From that page "that's too large to fetch all at once", I have plenty of memory, how can I tell SQLA or psycopg2 to load all the results into memory?

Thanks
Ed

--
You received this message because you are subscribed to the Google Groups 
"sqlalchemy" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to sqlalchemy+unsubscr...@googlegroups.com.
To post to this group, send email to sqlalchemy@googlegroups.com.
Visit this group at http://groups.google.com/group/sqlalchemy.
For more options, visit https://groups.google.com/d/optout.

Reply via email to