0

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

1
  • "Table partitioning" is a fancy name for "split a table into multiple tables". And since indexes are created per table then each partition has to have its own index. And so "yes", indexes can be partitioned as well. Commented Sep 8, 2020 at 7:04

1 Answer 1

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks for reply. So in my case - does it mean that index will be store in 2 tablespaces ? (SSD & magnetic HDDs volumes) ?
You will have to move the appropriate index partitions to the desired tablespace. That is not done automatically, but you can do it manually.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.