+--server-tuning
| +--dd
| +--fdtree
| +--fs
| +--loader
| +--memcached
| +--metadata
| +--network
| +--perflog
| | +--cron-perflog
| | +--sample-output
| +--postgres
| +--postmark
| +--raid
| +--ram
| +--scaling
| +--swap
| Postgres tuning
==> BBPostgres.pdf <==
==> PGDay2009-EN-Datawarehousing_with_PostgreSQL.pdf <==
==> choosing-primary-key <==
http://www.agiledata.org/essays/keys.html
Choosing a Primary Key: Natural or Surrogate?
Scott W. Ambler
Sun, 15 Aug 2010 13:16:38 -0400
This article overviews strategies for assigning primary keys to a table
within a relational database. In particular, it focuses on the issue of when
to use natural keys and when to use surrogate keys. Some people will tell
you that you should always use natural keys and others will tell you that
you should always use surrogate keys. These people invariably prove to be
==> default-values <==
http://openacs.org/doc/openacs-5-0-0/postgres.html
Tuning Postgres for OpenACS installation
Mon, 8 Mar 2004
The default values for PostgreSQL are very conservative; we can safely
change some of them and improve performance. Edit the PostgreSQL
config file, /usr/local/pgsql/data/postgresql.conf, to use more memory.
These values should improve performance in most cases.
# Shared Memory Size
==> horizontal-shard <==
http://stackoverflow.com/questions/994882/what-is-a-good-way-to-horizontal-shard-in-postgresql
what is a good way to horizontal shard in postgresql
Mar 24 at 19:49 WolfmanDragon
PostgreSQL allows partitioning in two different ways. One is by range
and the other is by list. Both use table inheritance to do partition.
Partitioning by range, usually a date range, is the most common,
but partitioning by list can be useful if the variables that is the
partition are static and not skewed.
==> managing-sequences <==
http://tech.myemma.com/managing-sequences-sharded-environment/
Sharding PostgreSQL sequences through trickery and deceit (don't tell our DBAs)
Kevin McConnell
Thu, 17 Mar 2011
Introduction
As is the case for many successful web applications, our databases
have grown considerably over the years. While there was a time that a
single moderately-sized PostgreSQL server could happily store all of our
==> partition-on-hash <==
http://stackoverflow.com/questions/2382089/optimal-database-table-optimization-method
Optimal database table optimization method
PostgreSQL partitioning is supported as of version 8.1. Partitioning
can help you avoid the problem of choosing between fast INSERT vs fast
DELETE performance. You can always partition the table by Year/Month, and
just drop the partitions that you no longer need. Dropping partitions is
extremely fast, and inserting into small partitions is also extremely fast.
From the manual:
==> performance-links <==
http://wiki.postgresql.org/wiki/Performance_Optimization
Performance Optimization
Thu, 21 Oct 2010 15:14:00 -0400
Contents
* 1 General Setup and Optimization
* 2 Critical maintenance for performance
* 3 Database architecture
* 4 Database Hardware Selection and Setup
==> postgres-and-ssd <==
Message-ID: <4D1FE347.8040008@hardwarefreak.com>
Date: Sat, 01 Jan 2011 20:30:31 -0600
From: Stan Hoeppner <stan@hardwarefreak.com>
To: debian-user@lists.debian.org
Subject: Re: PostgreSQL+ZFS
References: <4D1E6013.2010900@atifceylan.com>
<4D1F5543.3010108@hardwarefreak.com>
<201101011416.37472.bss@iguanasuicide.net>
In-Reply-To: <201101011416.37472.bss@iguanasuicide.net>
==> tablespaces <==
Tablespaces
* Internal label for a physical directory in the file system
* Can be created or removed at anytime
* Can store objects such as tables and indexes in different locations
* Good for scalability, performance
We can use it to implement partitioning:
* One master table with no rows.
==> temporary-tables <==
http://www.iwestdev.com/projects/postgresql/index.php
How to speed up a PostgreSQL database
It all started when a certain report crept up to about 4.5 minutes to
compile. All the complaints let us know something had to be done to speed
up the database. We started by increasing the memory from 256M to 1Gig.
This shaved about 2 minutes off, which left us at 2.5 minutes. Using the
'top' command it showed that there was no more virtual memory being used.
This led us to the conclusion that adding more memory might not get us to
where we want to be.
==> tips-and-tricks <==
http://www.gabrielweinberg.com/blog/2011/05/postgresql.html
PostgreSQL tips and tricks
Gabriel Weinberg
Sat, 28 May 2011 13:57:00 -0400
I've been using [4]PostgreSQL (an open-source database) for many years.
Here are some of the less obvious tips and tricks I've picked up. This post
isn't meant to be a comprehensive tuning or scaling guide, though I link to
some good documentation below.
|