Hi, In order to avoid bottlenecks I am force to limit the number of returned results using LIMIT and OFFSET. Since I am not returning all results upon a query I need to include the number of hits in the result. somequery.count() somequery.limit(n).offset(m).all() The problem is that response time takes twice as long as for either the count query or the query retrieving results. Is there any way to do this more efficiently, to make a query first, then to count results and return the result chunk defined with LIMIT and OFFSET? What is the best practice for this? Thanks ED
-- You received this message because you are subscribed to the Google Groups "sqlalchemy" group. To view this discussion on the web visit https://groups.google.com/d/msg/sqlalchemy/-/XXZtDSStLO8J. To post to this group, send email to sqlalchemy@googlegroups.com. To unsubscribe from this group, send email to sqlalchemy+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/sqlalchemy?hl=en.