I have a very slow query that takes 10s+ time on my machine. I am using SQLite and SQLAlchemy. Here are some details that I posted yesterday on Code Review SE: https://codereview.stackexchange.com/questions/196034/slow-flask-sqlalchemy-query-using-association-tables
Any help is appreciated.