# Logstash jdbc plugin: SELECT count(\*) on startup

**URL:** <https://discuss.elastic.co/t/logstash-jdbc-plugin-select-count-on-startup/56376>\
**Category:** Logstash\
**Created:** [July 26, 2016, 9:50am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-select-count-on-startup/56376 "2016-07-26T09:50:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![lorello](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lorello/32/9909_2.png) [@lorello](https://discuss.elastic.co/u/lorello)\
**Post date:** [July 26, 2016, 9:50am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-select-count-on-startup/56376/1 "2016-07-26T09:50:06Z")

</div>

I have a table on MySQL server that I want to push to ES.

I can accomplish this with the jdbc plugin, but I found it a little heavy on the mysql server, each time it starts it run a

```
SELECT count(*) AS `count` FROM (:statement)

```

where statement is the parameter i put in config file logstash.conf, why logstash needs to retrieve this count of records? Is it mandatory or we can skip this?

thanks in advance

---

<div class="post-metadata">

**Author:** ![vinpereira](https://avatars.discourse-cdn.com/v4/letter/v/977dab/32.png) [@vinpereira](https://discuss.elastic.co/u/vinpereira)\
**Post date:** [November 16, 2016, 12:38pm UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-select-count-on-startup/56376/2 "2016-11-16T12:38:10Z")

</div>

Same problem here.

I believe that the problem is with the JDBC plugin, not the Logstash itself. But I don't know how to stop this count(\*) from happening.

---

<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:30am UTC](https://discuss.elastic.co/t/logstash-jdbc-plugin-select-count-on-startup/56376/3 "2017-07-06T04:30:32Z")

</div>


