title: Pandas is faster to load CSV than SQL
body: <p>It seems that loading data from a CSV is faster than from SQL (Postgre SQL) with Pandas. (I have a SSD)</p>
  
  <p>Here is my test code :</p>
  
  <pre><code>import pandas as pd
  import numpy as np
  
  start = time.time()
  df = pd.read_csv('foo.csv')
  df *= 3
  duration = time.time() - start
  print('{0}s'.format(duration))
  
  engine = create_engine('postgresql://user:password@host:port/schema')
  start = time.time()
  df = pd.read_sql_query("select * from mytable", engine)
  df *= 3
  duration = time.time() - start
  print('{0}s'.format(duration))
  </code></pre>
  
  <p>The foo.csv and the database are the same (same amount of data and columns in both, 4 columns, 100 000 rows full of random int).</p>
  
  <p>CSV takes 0.05s</p>
  
  <p>SQL takes 0.5s</p>
  
  <p>Do you think it's normal that CSV is 10 time faster than SQL ? I'm wondering if I'm missing something here...</p>