Skip to main content
Commonmark migration
Source Link

We have a few tables with a large amount of data and with indexes on those tables to help in faster retrieval. We are also using Spring Data JPA [JpaRepository][1]JpaRepository for adding data to those tables using the .save(Iterable entities) method.

Now, I know that the index is going to slow down the inserts in the DB. But my question is that what is the impact of the .save() method on the indexes? Is it exactly the same as one would perform a normal insert into the table? Or is JPA smarter/better? I could not find any concrete answer on google for this.

FYI: we are using postgres 9 database and jboss application server. Please do let me know if any more information is needed. [1]: https://docs.spring.io/spring-data/jpa/docs/1.8.0.RELEASE/api/index.html?org/springframework/data/jpa/repository/JpaRepository.html

We have a few tables with a large amount of data and with indexes on those tables to help in faster retrieval. We are also using Spring Data JPA [JpaRepository][1] for adding data to those tables using the .save(Iterable entities) method.

Now, I know that the index is going to slow down the inserts in the DB. But my question is that what is the impact of the .save() method on the indexes? Is it exactly the same as one would perform a normal insert into the table? Or is JPA smarter/better? I could not find any concrete answer on google for this.

FYI: we are using postgres 9 database and jboss application server. Please do let me know if any more information is needed. [1]: https://docs.spring.io/spring-data/jpa/docs/1.8.0.RELEASE/api/index.html?org/springframework/data/jpa/repository/JpaRepository.html

We have a few tables with a large amount of data and with indexes on those tables to help in faster retrieval. We are also using Spring Data JPA JpaRepository for adding data to those tables using the .save(Iterable entities) method.

Now, I know that the index is going to slow down the inserts in the DB. But my question is that what is the impact of the .save() method on the indexes? Is it exactly the same as one would perform a normal insert into the table? Or is JPA smarter/better? I could not find any concrete answer on google for this.

FYI: we are using postgres 9 database and jboss application server. Please do let me know if any more information is needed.

Source Link

Performance impact of JPARepository save() on a large database table with index

We have a few tables with a large amount of data and with indexes on those tables to help in faster retrieval. We are also using Spring Data JPA [JpaRepository][1] for adding data to those tables using the .save(Iterable entities) method.

Now, I know that the index is going to slow down the inserts in the DB. But my question is that what is the impact of the .save() method on the indexes? Is it exactly the same as one would perform a normal insert into the table? Or is JPA smarter/better? I could not find any concrete answer on google for this.

FYI: we are using postgres 9 database and jboss application server. Please do let me know if any more information is needed. [1]: https://docs.spring.io/spring-data/jpa/docs/1.8.0.RELEASE/api/index.html?org/springframework/data/jpa/repository/JpaRepository.html