<p>There are also situations where using SQL is far more efficient than Python. If your database resides on a server and your Python code executes on a different machine, any data you want to process has to be sent across some kind of network connection. Any filtering or aggregation that's needed is far better executed on the database server so that only the required data is sent across the network. If your process is to extract some data, manipulate it in some way and send it straight back to the database for persistence, that will almost always be more efficient if you issue SQL statements to the database server than bringing the data across the network and sending the results back again.</p>
0 commit comments