title: Increment speed on query data to Bigquery
body: <p>I'm developing an application to execute many queries into bigquery using Jobs.Query class. This is my piece of code:</p>
  
  <pre><code>    public JObject getData(BigqueryService service, String query)
      {
          JObject result = new JObject();
          JobsResource j = service.Jobs;
          QueryRequest qr = new QueryRequest();
          qr.Query = query;
  
          QueryResponse response =  j.Query(qr, projectId).Execute();
          if ((bool)response.JobComplete)
          {
              return getResults(response.Schema, response.Rows);
          }
          else
          {
              DateTime start = DateTime.UtcNow;
              while (true) {
                  GetQueryResultsResponse response2 = service.Jobs.GetQueryResults(projectId, response.JobReference.JobId).Execute();
                  if ((bool)response2.JobComplete)
                  {
                      return getResults(response2.Schema, response2.Rows);
                  }
                  DateTime end = DateTime.UtcNow;
                  TimeSpan total = new TimeSpan(end.Ticks - start.Ticks);
                  if (total.Minutes &gt; 0 || total.Seconds &gt; 50) return getResults(null, null);
                  Thread.Sleep(1000);
              }
  
          }
      }
  </code></pre>
  
  <p>My problem is that the query execution is very slow for the size of data. Are there any way to increase speed of the query?</p>
  
  <p>I'm talking about a table that contain more than 20 milion rows.</p>
  
  <p>Today, I've done a list with querys timestamps. Each timestamp is the time of execution the 4 querys. </p>
  
  <p>-00:00:06.2929905
  -00:00:06.8925675
  -00:00:05.0319329
  -00:00:05.6336228
  -00:00:07.2206028
  -00:00:05.2911213
  -00:00:05.0546701
  -00:00:04.3276083
  -00:00:05.7575818
  -00:00:04.1528799
  -00:00:05.2664854
  -00:00:05.0738185
  -00:00:05.5472279
  -00:00:05.1223429
  -00:00:04.7509914
  -00:00:04.9643928
  -00:00:04.5182521
  -00:00:04.6950590
  -00:00:06.0061839
  -00:00:06.7736054
  -00:00:06.3931505
  -00:00:06.0068689
  -00:00:07.2904883
  -00:00:04.3762012
  -00:00:09.7467363
  -00:00:12.9430536
  -00:00:11.4525429
  -00:00:13.4580112
  -00:00:07.2501061
  -00:00:11.9368635
  -00:00:20.0649572
  -00:00:22.8073734
  -00:00:33.5651125
  -00:00:20.3412234
  -00:00:41.2743429
  -00:00:46.3231917
  -00:01:03.8191158
  -00:00:33.4181420
  -00:00:42.9427840
  -00:00:26.3853840
  -00:00:19.3615288
  -00:00:20.6219836
  -00:00:23.1905747</p>
  
  <p>Is it possible that when more queries executed, BigQuery will run more slower?</p>
  
  <p>Thanks</p>
  
  <p><strong>22/08/2014 EDIT:</strong> After several days,I noticed that depending the time of day, the queries run more slower o more faster. Is possible that these queries run slowly because the source table is filled through InsertAll() (streaming data) ?</p>
  
  <p>There are any way to run this queries more faster? (4-10 seconds always) </p>