title: How to improve performance of a simple select query in oracle
body: <p>I recently got into an interview and I was asked a question</p>
  
  <p>We have a table <code>employee(id, name)</code>. And in our java code, we are writing a logic to fetch data from this table and display it in UI. The query is</p>
  
  <p><code>Select id,name from employee</code></p>
  
  <p>Query was that during debugging, we found that this jdbc call to fire the query and get the output is taking say 20 secs and we want to reduce this to say 5 seconds or to the optimal time. How can we you do that, or how will I tackle this problem?</p>
  
  <p>As there is no <code>where clause</code> in the query, I didn't suggest to index the column.
  As this logic is taking 20 secs every time, so, some other code getting a lock on this table is also out of question.
  I suggested that limiting the number of records fetched from the table should help but the interviewer didn't look convinced</p>
  
  <p>Is there anything else we can do as a developer to optimize the call. I guess DBA might tune database setting to improve the performance of this query, but is there any other way</p>