I need your help to solve a problem as I am fairly new to Postgres and reading the manuals didn’t help.
We have a server with 4 internal hard disks. We have created a Postgres database with a few tables. We want to be able to spread our data across these 4 disks.
We want to specify somewhere (eg table space creation stage) that the data loaded into a set of tables should be distributed across the 4 disks.
Can you kindly give us the syntax or point us in the right direction?
A table space is a logical unit of storage in a database. Generally speaking, spreading database table spaces across multiple disks improves performance. A table space can be System Managed Space (SMS) or Database Managed Space (DMS).
Citus is a PostgreSQL extension that transforms Postgres into a distributed database—so you can achieve high performance at any scale.
No, you can only have a single statement executing at the same time on a PostgreSQL connections.
ALTER TABLE foobar SET tablespace = foospace
, see here: http://www.postgresql.org/docs/current/static/sql-altertable.html alter index idx_foo set tablespace = spacefoo
, see here: http://www.postgresql.org/docs/current/static/sql-alterindex.html The best way is to create a RAID-0 or RAID-10 array and let the OS handle this for you. RAID-0 has no redundancy so any single drive failure is catastrophic. RAID-10 allows for any one disk to fail and keep right on working with good performance. Avoid RAID-5 or RAID-6 due to very poor write performance.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With