On Monday, July 6, 2020 at 2:14:33 PM UTC-4, Saylee M. wrote:
> So, when I passed the query to MySQL directly, it took very less time > (around 0.016 seconds) but when I passed the same > query through SQLAlchemy connector, it took around 600 seconds > "query ... MySQL directly" Do you mean using the MySQL commandline client? Assuming yes, the 0.016 time only reflects the time MySQL spent processing the query and generating the result set; the SQLAlchemy time includes that + transferring all the data + generating Python data structures (which could be SQLAlchemy ORM models or generic python data structures) There are also external factors that can account for time changes - like server load, index loading, cache utilization.... I am not sure what can be issue. It'll be great if I can get any pointers > to reduce the time, preferably under 10 seconds! > Showing a short, self contained, correct example (sscce) of your code would let others troubleshoot it more effectively. The most likely situation though, is that you are loading all the rows. There should be no difference in the query time. -- SQLAlchemy - The Python SQL Toolkit and Object Relational Mapper http://www.sqlalchemy.org/ To post example code, please provide an MCVE: Minimal, Complete, and Verifiable Example. See http://stackoverflow.com/help/mcve for a full description. --- 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 view this discussion on the web visit https://groups.google.com/d/msgid/sqlalchemy/1b1d83d9-eb01-4541-962a-3d4a6551afb9o%40googlegroups.com.