# JDBC Input Plugin Count I/O Error

**URL:** <https://discuss.elastic.co/t/jdbc-input-plugin-count-i-o-error/153652>\
**Category:** Logstash\
**Created:** [October 23, 2018, 4:55pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-count-i-o-error/153652 "2018-10-23T16:55:56Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Johnathan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnathan/32/36849_2.png) [@Johnathan](https://discuss.elastic.co/u/Johnathan)\
**Post date:** [October 23, 2018, 4:55pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-count-i-o-error/153652/1 "2018-10-23T16:55:56Z")

</div>

I have a rather large query that will be picking up several million records from a Postgres DB and indexing into Elasticsearch. I have always used the jdbc input plugin for taking data from a RDBMS and putting it into Elasticsearch. This process now, however, is running a `count` with my query embedded as a sub query. This ends up running for so long that it never completes and causes an I/O error to be thrown.

I don't really understand the necessity of having this within the jdbc input plugin, but has anyone experienced this and found a work around for it?

I tried manually running this count query on my own outside of logstash and I stopped it after it had attempted to run for over 30 minutes.

---

<div class="post-metadata">

**Author:** ![Johnathan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/johnathan/32/36849_2.png) [@Johnathan](https://discuss.elastic.co/u/Johnathan)\
**Post date:** [October 24, 2018, 1:40pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-count-i-o-error/153652/2 "2018-10-24T13:40:03Z")

</div>

Looking at the ruby code for the jdbc input filter, there is a file 'checked\_count\_logger.rb' which has the following:

```
return unless @in_debug
check_count_query(query) if @needs_check

```

and within the `initialize` method in that same file:

`@in_debug = @logger.debug?`

Is there a config setting or jdbc input setting to force this to be FALSE so that count doesn't get run?

---

<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:** [November 21, 2018, 1:40pm UTC](https://discuss.elastic.co/t/jdbc-input-plugin-count-i-o-error/153652/3 "2018-11-21T13:40:03Z")

</div>

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