|
|
|
|
|
by zlynx
1932 days ago
|
|
Postgres has some features that are excellent for logging. For example, instead of inserting everything into a log table and deleting old entries and needing to vacuum things, use a partitioned table and just DROP entire partitions when they age out. You can summarize them into some kind of summary table before that, of course. The partitions are good for the summaries too. Instead of doing index scans on the range of dates across a terabyte of logs, it is a full table scan on a partition of a single day or hour. You can use a separate database for logging but the one time we did that it got weird. We ended up doing reporting scripts that had to first copy tables from the active DB to the logging DB so we could use them to JOIN on some log columns. They weren't huge but if everything had been in the same DB it wouldn't have been needed. All of the scripts and procedures I know of were custom written for this. I don't know of any good prepackaged Postgres logging configs, but they may be out there. |
|