title: Spark, executors loading/querying data - very low performance
body: <p>My use case is following:   </p>
  
  <p>Wrtiting <code>RDD</code> to file by <code>saveAsTable</code> (so to ORC files).  Each saving creates new file (so <code>1000 000</code> writings give me <code>1000 000</code> ORC files).  I know that it is natural that for each RDD there are created new ORC files(s).  However, I don't knwo why it is so slow when it comes to query them from ThriftServer.   </p>
  
  <p>My question is: How to understand such strange behaviour ?<br>
  For example, <code>SELECT COUNT(*)</code> on 1000 000 rows (so the same files) takes about <code>1 minute</code> (!).<br>
  However, when I save <code>1000 000</code> rows to one file, the same query works in <code>50ms</code>.  </p>
  
  <p>I would like to understand this difference. After all, <code>1000 000</code> files it is small number.</p>