Skip to content
Search

PostgreSQL:Tablespace

lastmod 2021-03-03created 2021-02-252 edits

Tablespaces in PostgreSQL allow database administrators to define locations in the file system where the files representing database objects can be stored. Once created, a tablespace can be referred to by name when creating database objects.

By using tablespaces, an administrator can control the disk layout of a PostgreSQL installation. This is useful in at least two ways. First, if the partition or volume on which the cluster was initialized runs out of space and cannot be extended, a tablespace can be created on a different partition and used until the system is reconfigured.

Second, tablespaces allow an administrator to use knowledge of the usage pattern of database objects to optimize performance. For example, a heavily used index can be placed on a fast, highly available disk, such as an expensive SSD. At the same time, a table storing archived data that is rarely used or not performance-critical can be stored on a slower, less expensive disk system.

See also

Favorite site

author Zer0 sitemap