# Jdbc\_page\_size doesn't dump all my data to elastic search

**URL:** <https://discuss.elastic.co/t/jdbc-page-size-doesnt-dump-all-my-data-to-elastic-search/101590>\
**Category:** Logstash\
**Created:** [September 24, 2017, 4:44am UTC](https://discuss.elastic.co/t/jdbc-page-size-doesnt-dump-all-my-data-to-elastic-search/101590 "2017-09-24T04:44:31Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![woshitom](https://avatars.discourse-cdn.com/v4/letter/w/a587f6/32.png) [@woshitom](https://discuss.elastic.co/u/woshitom)\
**Post date:** [September 24, 2017, 4:44am UTC](https://discuss.elastic.co/t/jdbc-page-size-doesnt-dump-all-my-data-to-elastic-search/101590/1 "2017-09-24T04:44:31Z")

</div>

I'd like to export tom\_test2 postgresql table to elastic search. The table has 176805 rows:

```
=> select count(*) from tom_test2;
 count  
--------
 176805
(1 row)

```

The following logstach conf file import correctly my data to elastic search:

```
input {
    jdbc {
        # Postgres jdbc connection string to our database, mydb
        jdbc_connection_string => "xxx"
        # The user we wish to execute our statement as
        jdbc_user => "xxx"
        jdbc_password => "xxx"
        # The path to our downloaded jdbc driver
        jdbc_driver_library => "xxx"
        # The name of the driver class for Postgresql
        jdbc_driver_class => "org.postgresql.Driver"
        # our query
        statement => "select * from tom_test2"
    }
}

output {
    elasticsearch {
        hosts => ["xxx"]
        index => "tom"
        document_type => "tom_test"
    }
}

```

In elastic search:

```
GET tom/tom_test/_search

  "hits": {
    "total": 176805,
    "max_score": 1
}

```

I'm deleting my index in elastic search:

`delete tom`

And I now would like to do the same operation using jdbc\_page\_size in case my data becomes bigger, my logstach conf file is now:

```
input {
    jdbc {
        # Postgres jdbc connection string to our database, mydb
        jdbc_connection_string => "xxx"
        # The user we wish to execute our statement as
        jdbc_user => "xxx"
        jdbc_password => "xxx"
        # The path to our downloaded jdbc driver
        jdbc_driver_library => "xxx"
        # The name of the driver class for Postgresql
        jdbc_driver_class => "org.postgresql.Driver"
        # our query
        statement => "select * from tom_test2"

        jdbc_page_size => 1000
        jdbc_paging_enabled => true
    }
}

output {
    elasticsearch {
        hosts => ["xxx"]
        index => "tom"
        document_type => "tom_test"
    }
}

```

My count is now wrong:

```
GET tom/tom_test/_search

  "hits": {
    "total": 106174,
    "max_score": 1,
}

```

as 176805-106174=70631 rows are missing

---

<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:** [October 22, 2017, 4:44am UTC](https://discuss.elastic.co/t/jdbc-page-size-doesnt-dump-all-my-data-to-elastic-search/101590/2 "2017-10-22T04:44:36Z")

</div>

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