POSTGRESQL – Slow index of 300GB Postgis table

I load about 300GB of contour data into the postgis table. To speed up the process, I read that it is the fastest to load the data first, and then create an index. It only takes about 2 to load the data Days, but now I have waited for about 30 days for the index and it is not ready yet.

The query is:

create index idx_contour_geom on contour.contour using gist(geom);

I run it in pgadmin4, and the memory consumption of progran ranges from 500MB to 100GB.

Use such a long time to index such a database Is it normal?

Any tips on how to speed up the process?

Edit:
Data is loaded from 1×1 degree (latitude/longitude) units (about 30.000 units), so no line has a bounding box larger than 1×1 degree, and then most of it should be small Much. They are in EPSG: 4326 projection, the only attributes are height and geometry (geom).

I changed the maintenance_work_mem to 1GB and stopped all other writes to the disk (many insert operations are attached with ANALYZE, which takes up a lot of resources). I have run for 23 minutes now.

I Load about 300GB of contour data into the postgis table. To speed up the process, I read that it is the fastest to load the data first, and then create an index. It only takes about 2 days to load the data, but now I have waited for about 30 days. The index is not ready yet.

The query is:

create index idx_contour_geom on contour.contour using gist(geom);

pre>

I run it in pgadmin4, and the memory consumption of progran ranges from 500MB to 100GB.

Is it normal to index such a database for such a long time?

Any tips on how to speed up the process?

Edit:
Data is loaded from 1×1 degree (latitude/longitude) units (about 30.000 units), so no line has a bounding box larger than 1×1 degree, and then most of it should be small Much. They are in EPSG: 4326 projection, the only attributes are height and geometry (geom).

I changed maintenance_work_mem to 1GB and stopped all others Write to disk (many insert operations are attached with ANALYZE, which takes up a lot of resources). I ran for 23 minutes now.

Leave a Comment

Your email address will not be published.