This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This seems like such a common use case, but I couldn't find any examples after looking through all of the documentation | |
| of SQLAlchemy and random spots on the internet. Posting in case it's helpful to others. | |
| You can run this on any data, just have to update the queries. The code compares serial and parallel query execution. | |
| It shows the number of connections used from the engine's pool by each (serial is one, parallel is 5). I did the view creation | |
| just trying to hit queries that would take time, but any queries will do. | |
| There are other recipes for parallel execution that may be more applicable to your use case. | |
| """ |