# It takes lots of time initializing the query when using logstash-input-jdbc

**URL:** <https://discuss.elastic.co/t/it-takes-lots-of-time-initializing-the-query-when-using-logstash-input-jdbc/95152>\
**Category:** Logstash\
**Created:** [July 31, 2017, 9:06am UTC](https://discuss.elastic.co/t/it-takes-lots-of-time-initializing-the-query-when-using-logstash-input-jdbc/95152 "2017-07-31T09:06:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![lunatic](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lunatic/32/55516_2.png) [@lunatic](https://discuss.elastic.co/u/lunatic)\
**Post date:** [July 31, 2017, 9:06am UTC](https://discuss.elastic.co/t/it-takes-lots-of-time-initializing-the-query-when-using-logstash-input-jdbc/95152/1 "2017-07-31T09:06:35Z")

</div>

Hi,  
I'm using logstash-input-jdbc and I got some errors.  
There are about 5 million records in my db(MySQL) and I want to put them into es. And there is lots of 'join' operations like  
"select \* from table1  
left join table2 on xxx  
left join table3 on xxx  
left join table4 on xxx  
....  
....  
...."  
when I start logstash I got it takes lots of time of waiting for the operation in logstash like that:  
SELECT count(\*) AS `count` FROM (my select sql) AS `t1` LIMIT 1;

how could I decrease the time or could I jump over the step?  
Thanks.

---

<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:** [August 28, 2017, 9:07am UTC](https://discuss.elastic.co/t/it-takes-lots-of-time-initializing-the-query-when-using-logstash-input-jdbc/95152/2 "2017-08-28T09:07:15Z")

</div>

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