Dealing with giant tables in Postgres using Partitioning

Operation towards very large tables takes too much time in database. To overcome this problem, Postgres introduced partitioning using pg_partman extension. Steps to implement 1. Install extensionCREATE EXTENSION pg_partman; 2. Create tableCREATE TABLE events; 3. Create parent index tableSELECT create_parent(‘public.events’, ‘created_at’, ‘time’, ‘daily’); 4. Run partitioningSELECT run_maintenance(); Reference https://blog.heroku.com/handling-very-large-tables-in-postgres-using-partitioning