Maciej
Maciej

Reputation: 10805

Postgres - indexes partitioning

I have psql (12) database installed on ultra fast (and expensive) SSDs - works great there However my DB is rapidly growing so instead of investing fortune in SSDs expanding - Im more thinking to install cheaper disk volume based on standard (magnetic) HDDs.

I read about table partitioning and this is what might help here, but I coudnt find information what about indexes? Can those be also partitioned / stored on 2 different volumes, depending where table partition reside ?

This is quite important to me because indexes are almost 30% size of biggest table

Appreciate your comments / advice

Upvotes: 0

Views: 2977

Answers (1)

Laurenz Albe
Laurenz Albe

Reputation: 246568

The documentation says:

Create an index [...] on the partitioned table. [...] This automatically creates one index on each partition, and any partitions you create or attach later will also contain the index.

So yes, indexes will be partitioned just like the table.

Upvotes: 1

Related Questions