Posts

Showing posts from January, 2018

How To Partitioning on PostgreSQL 9.6

Hello, I'm gonna share my experience on partitioning and show how affect partition on scripts. I'm gonna show you how to partitioning on existing table. Let's begin to following steps; Create new table. It's gonna be partitioned table. Create partition tables. Grant privileges to partition tables and partitioned table. Generate function and trigger on partitioned table. Insert data from main table to partitioned table. Create indexes if you had on main table on partition tables. Check partition tables everything is fine. Rename main table. Rename partitioned table name like main table Drop old main table. Not that: if you have some indexes or constraint on your main table, not to increase inserting time you should create your new main table and other partition tables without constraints and indexes. After insert whole data to partition tables you can add indexes and constraints. It will be help you to executing insert statement more quickly.  Bef