title: Query on large, indexed table times out
body: <p>I am relatively new to using Postgres, but am wondering what could be the workaround here.</p>
  
  <p>I have a table with about 20 columns and 250 million rows, and an index created for the timestamp column <code>time</code> (but no partitions).</p>
  
  <p>Queries sent to the table have been failing (although using the view first/last 100 rows function in PgAdmin works), running endlessly.  Even simple <code>select *</code> queries.</p>
  
  <p>For example, if I want to LIMIT a selection of the data to 10 </p>
  
  <pre><code>SELECT * from mytable
  WHERE time::timestamp &lt; '2019-01-01'
  LIMIT 10;
  </code></pre>
  
  <p>Such a query hangs - what can be done to optimize queries in a table this large?  When the table was of a smaller size (~ 100 million rows), queries would always complete.  What should one do in this case?</p>