title: Is it faster to requery from SQL or loop in an ArrayList and filter data in Java?
body: <p>I hava an ArrayList that got filled from an SQL query and contains all the rows of a table.</p>
  
  <p>If I want a subset of this ArrayList (say WHERE column1 = x)<br>
  Is it faster to remake an SQL connection and fetch a query with this condition, or loop through the arraylist and filter the data ? (considering an arraylist of 1000 rows)</p>
  
  <p>If the loop through the arraylist is faster, until what size is it still appliable ?</p>
  
  <p>Thank you</p>