pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Marius <lonepsycho@gmail.com>
To: drum.lucas@gmail.com <drum.lucas@gmail.com>
To: pgsql-admin@postgresql.org <pgsql-admin@postgresql.org>
Subject: Re: Table size - optimization
Date: Mon, 14 Dec 2015 13:24:48 +0200
Message-ID: <566ea6cb.46b71c0a.17f65.5010@mx.google.com> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-admin>

You could simply rename old table, create new one and all in same transaction. No data move required.

-----Original Message-----
From: drum.lucas@gmail.com
Sent: 2015.12.14 06:37
To: pgsql-admin@postgresql.org
Subject: [ADMIN] Table size - optimization


Feedlog is a central area where theres been a lot of data dumped together and the beast has grown.




Whats a better way to design the db table(s) for feedlog so we can get a very large performance gain.




Is there a way we can create a feedlog-history table or yearly tables eg feedlog-2014 and move old data out of the original table so its a kean fast table?




What code would need to change to deal with that?




Some data :





Size: 8 GB

      



relname      | relkind |  reltuples  | relpages

-------------------+---------+-------------+----------

 feedlog        | r       | 6.60508e+07 |  9974857













Thanks,

Lucas
 =

view thread (2+ messages)

Message-ID: <566ea6cb.46b71c0a.17f65.5010@mx.google.com>
Permalink:  ../566ea6cb.46b71c0a.17f65.5010@mx.google.com/
Also on:    postgresql.org/message-id/566ea6cb.46b71c0a.17f65.5010@mx.google.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-admin@postgresql.org
  Cc: lonepsycho@gmail.com, drum.lucas@gmail.com
  Subject: Re: Table size - optimization
  In-Reply-To: <566ea6cb.46b71c0a.17f65.5010@mx.google.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox