Re: [sqlalchemy] similar to OrderingList but order in code instead of via sql?

2016-10-27 Thread mike bayer
works for me! at least I have the plan for the next time this comes up. On 10/27/2016 12:42 PM, Paul Winkler wrote: Wow, thanks for the very detailed reply Mike! This is rather anticlimactic followup I'm afraid :) But we mulled this over a bit and just slapped an index on the column in

Re: [sqlalchemy] similar to OrderingList but order in code instead of via sql?

2016-10-27 Thread Paul Winkler
Wow, thanks for the very detailed reply Mike! This is rather anticlimactic followup I'm afraid :) But we mulled this over a bit and just slapped an index on the column in question instead. - Paul On Wednesday, October 26, 2016 at 9:19:23 PM UTC-4, Mike Bayer wrote: > > > > On 10/26/2016 05:50

Re: [sqlalchemy] similar to OrderingList but order in code instead of via sql?

2016-10-26 Thread mike bayer
On 10/26/2016 05:50 PM, Paul Winkler wrote: So I currently have this: thingies = relationship( "Thingy", order_by="Thingy.sort_order", collection_class=ordering_list("sort_order"), ) But could maybe change it to: thingies = relationship(

[sqlalchemy] similar to OrderingList but order in code instead of via sql?

2016-10-26 Thread Paul Winkler
Hi all, I've been happily using OrderingList as a collection_class for some time. Recently discovered a slow query due to multiple JOINs where the order_by on the relationship ends up causing a table scan because the field in question is not indexed. One solution of course would be to add an