# Does Logstash cache the Query Results (JDBC-Input)

**URL:** <https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312>\
**Category:** Logstash\
**Created:** [October 18, 2016, 4:01pm UTC](https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312 "2016-10-18T16:01:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![TWalter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/twalter/32/41239_2.png) [@TWalter](https://discuss.elastic.co/u/TWalter)\
**Post date:** [October 18, 2016, 4:01pm UTC](https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312/1 "2016-10-18T16:01:30Z")

</div>

Hello there,

i have an important question about the processes in Logstash.

If i Query from a relational Database except 5000 entries. Does Logstash cache the 5000 an executes the filter and output like in a for-loop?

Or does Logstash get one entry, then filter, then output and next entry, then filter, then output (5000 times)?

Thanks for your help.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 20, 2016, 2:01am UTC](https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312/2 "2016-10-20T02:01:44Z")

</div>

It batches, but in smaller groupings than the entire dataset.

---

<div class="post-metadata">

**Author:** ![TWalter](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/twalter/32/41239_2.png) [@TWalter](https://discuss.elastic.co/u/TWalter)\
**Post date:** [October 20, 2016, 10:03am UTC](https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312/3 "2016-10-20T10:03:37Z")

</div>

Thanks =) that was important for understanding the behaviour of Logstash =)

---

<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:** [July 6, 2017, 4:33am UTC](https://discuss.elastic.co/t/does-logstash-cache-the-query-results-jdbc-input/63312/4 "2017-07-06T04:33:26Z")

</div>


