Is there a way to slow down index creation or tune it somehow to use fewer resources?
A bit of context, we have a pretty big database with 200M rows in the root table, and probably some tables have even billions of rows due to one-to-many relations. Of course, for index creation, we use CONCURRENTLY index, and recently, without any config changes, index creation behaviour has changed a lot. For example, a month ago, to create an index it took ~12 hours, but last 3 indexes (they were not created together, few days passed between each index) were created in 2-5 minutes. Which is great, but during that time CPU spiked to 80% (it usually around 15-20% ) and shred memory from 2-3GB to almost 200GB. The number of maintenance workers is 2, and worker memory is 4Gb.
Is there a way to make index creation slower but less resource-hungry???
Asked by Bogdan Dubyk
(111 rep)
Jul 21, 2025, 10:22 AM
Last activity: Jul 21, 2025, 11:06 AM
Last activity: Jul 21, 2025, 11:06 AM