From: Magnus Hagander <magnus@hagander.net>
To: Jessica Richard <rjessil@yahoo.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: index performance on large tables with update and insert
Date: Fri, 23 May 2008 12:35:17 -0400
Message-ID: <20080523123517.6305fbde@mha-laptop.hagander.net> (raw)
In-Reply-To: <334290.54805.qm@web56401.mail.re3.yahoo.com>
References: <334290.54805.qm@web56401.mail.re3.yahoo.com>
Jessica Richard wrote:
> I have a large table with about 2 million rows and it will keep
> growing...
>
> I need to do update/inserts, and select as well.
>
> An index will speed up the select, but it will slow down the updates.
>
> Are all Postgres indexes ordered? i.e., with every update, the index
> pages will have to be physically reordered?
>
> Does Postgres have any kind of non-ordered indexes (like Syabse's
> non-clustered index)?
All PostgreSQL indexes are like the non-clustered ones in Sybase or SQL
Server.
> What is the common way to take care of the performance issue when you
> have to do both update and select on the same large table?
Create the indexes you actually need to make the selects and updates
fast, just make sure you don't create any unnecessary ones. Usually,
your UPDATEs will also require indexes - only the INSERTs actually are
losing.
//Magnus
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: magnus@hagander.net, rjessil@yahoo.com
Subject: Re: index performance on large tables with update and insert
In-Reply-To: <20080523123517.6305fbde@mha-laptop.hagander.net>
References: <334290.54805.qm@web56401.mail.re3.yahoo.com> <20080523123517.6305fbde@mha-laptop.hagander.net>
* 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