How to do indexing, partition, and migration in Postgres 10: Difference between revisions

From DISI
Jump to navigation Jump to search
(Created page with "This tutorial shows how to do data migration, partition, and indexing in Postgres 10. ''1. Migrate data directory'' The dataset is quite large, and it will take up about 220...")
 
No edit summary
Line 7: Line 7:
(1) Check current Postgres data directory.
(1) Check current Postgres data directory.
<pre>
<pre>
# log into Postgres
sudo -i  
sudo -i  
su - postgres
su - postgres
psql
psql
SHOW data_directory;
SHOW data_directory;
</pre>
<pre>
Output
    data_directory     
-------------------------
/var/lib/pgsql/10/data
(1 row)
</pre>
</pre>

Revision as of 20:21, 3 August 2018

This tutorial shows how to do data migration, partition, and indexing in Postgres 10.

1. Migrate data directory

The dataset is quite large, and it will take up about 220GB of hard disk once loaded and indexed into Postgres. It is better to move the database storage to another large disk instead of the default (root) one. A Solid State Disk (SSD) is preferred for faster disk access.

(1) Check current Postgres data directory.

sudo -i 
su - postgres
psql
SHOW data_directory;
Output
     data_directory      
-------------------------
 /var/lib/pgsql/10/data
(1 row)