# Jdbc input, its really necessary to order the results ascending?

**URL:** <https://discuss.elastic.co/t/jdbc-input-its-really-necessary-to-order-the-results-ascending/229820>\
**Category:** Logstash\
**Created:** [April 26, 2020, 7:53am UTC](https://discuss.elastic.co/t/jdbc-input-its-really-necessary-to-order-the-results-ascending/229820 "2020-04-26T07:53:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![ElasticLiver](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/elasticliver/32/64869_2.png) [@ElasticLiver](https://discuss.elastic.co/u/ElasticLiver)\
**Post date:** [April 26, 2020, 7:53am UTC](https://discuss.elastic.co/t/jdbc-input-its-really-necessary-to-order-the-results-ascending/229820/1 "2020-04-26T07:53:49Z")

</div>

hi, im getting data from a postgregs db, the tracking column that im using is unix epoch called clock this is part of my conf:

```auto
  input{                            
                "...other parameters...
                and clock > :sql_last_value
                order by clock asc"
                schedule => "*/30 * * * *"
                use_column_value => true
                record_last_run => true
                tracking_column => "clock"
}

```

I was wandering if its really necessary to order the results ascending, because it takes to long when I use order by....what will be the problem if I dont use order by?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 24, 2020, 7:53am UTC](https://discuss.elastic.co/t/jdbc-input-its-really-necessary-to-order-the-results-ascending/229820/2 "2020-05-24T07:53:57Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
