title: SQLALCHEMY: Perform bulk SELECT statement
body: <p>I was trying to send a bunch of select statements to a single database using sqlalchemy unfortunately, my approach did not succeed. All my queries are also conditioned to look into indexed columns. I filter on a list of different combinations for the conditions.  Here is my current approach</p>
  
  <pre><code>condition1 = [1,2,3,4,5,6,7,8,9]
  condition2 = [1,2,3,4,5,6,7,8,9]
  
  queries_collection = []
  
  for condition_value1 in condition1:
  
      for condition_value2  in condition2:
  
          condition = and_(
                          DataModel.column1 == int(condition_value1),
                          DataModel.column2 ==  int(condition_value2))
  
          queries_collection.append(
  
             self.db.session.query(DataModel).filter(condition)
  
          )
  
  
  self.db.session.add_all(queries_collection)
  result = self.db.session.execute()
  </code></pre>
  
  <p>Following an example of how to use add_all() found here <a href="https://github.com/sqlalchemy/sqlalchemy/wiki/FilteredQuery" rel="nofollow noreferrer">https://github.com/sqlalchemy/sqlalchemy/wiki/FilteredQuery</a></p>
  
  <p>Generally, can I first create all queries and then execute them in bulk?</p>
  
  <p>What am I missing?</p>