How to Speed ​​Up Insert Performance in CockroachDB

Is there a way to optimize inserting a lot of data into an empty CockroachDB table?

+5
source share
1 answer

To optimize the insertion of data into CockroachDB tables, there are a few tips:

  • Create a table without any secondary indexes, insert your data and add any secondary indexes you want.
  • Insert 500 lines into an INSERT . This number may vary slightly depending on the size of your lines, but is a good guide for optimizing the speed at which you can write data.

If you are switching from PostgreSQL to CockroachDB, you can also use pg_dump to create a COPY statement that CockroachDB is optimized for swallowing. This is a slightly more complicated process, but you can find information on how to do this in the CockroachDB import documentation .

+4
source

Source: https://habr.com/ru/post/1266605/


All Articles