[sqlalchemy] Re: Modifying results of a KeyedTuple query?

2018-08-14 Thread James Couch
Just a quick followup... Thanks again for the help/advice. I did what you suggested, and the whole query (with bulk_update_mappings) takes .16 seconds to return a result set of 7800 records or so. That's up from ~1.2 seconds it took before I did the optimizations. -- SQLAlchemy - The Python

Re: [sqlalchemy] Modifying results of a KeyedTuple query?

2018-08-10 Thread James Couch
query on the id or something. On Friday, August 10, 2018 at 4:21:32 PM UTC-5, James Couch wrote: > > I think I see what you mean. Do an inline query/update, maybe just query > by primary index for speed. I guess that won't add too much overhead, I'll > give it a shot. > > On

Re: [sqlalchemy] Modifying results of a KeyedTuple query?

2018-08-10 Thread James Couch
I think I see what you mean. Do an inline query/update, maybe just query by primary index for speed. I guess that won't add too much overhead, I'll give it a shot. On Friday, August 10, 2018 at 1:43:51 PM UTC-5, Mike Bayer wrote: > > You need to copy the keyedtuples into some other data

Re: [sqlalchemy] Modifying results of a KeyedTuple query?

2018-08-10 Thread James Couch
On Friday, August 10, 2018 at 4:03:06 PM UTC-5, Jonathan Vanasco wrote: > > > A quick background on Mike's short answer... Tuples are immutable lists in > Python, and "KeyedTuple" should indicate that you can't change the values. > They're just a handy result storage object, not an ORM object

[sqlalchemy] Modifying results of a KeyedTuple query?

2018-08-10 Thread James Couch
Hey all. Long time lurker, first time poster. I'm using sqlalchemy ORM. We have a fairly decent sized data set, and one table has a pretty large number of columns, some of them with foreignkeys. I found that limiting a query to specific columns speeds up the time it takes to come back with a