Skip site navigation (1) Skip section navigation (2)

Re: Insert performance vs Table size

From: Jacques Caron <jc(at)directinfos(dot)com>
To: "Praveen Raja" <praveen(dot)raja(at)netlight(dot)se>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Insert performance vs Table size
Date: 2005-06-27 11:40:13
Message-ID: 6.2.0.14.0.20050627133508.05df6eb0@pop.interactivemediafactory.net (view raw or flat)
Thread:
Lists: pgsql-performance
Hi,

At 13:24 27/06/2005, Praveen Raja wrote:
>I'm wondering if and how the size of a table affects speed of inserts
>into it? What if the table has indexes, does that alter the answer?

Many parameters will affect the result:
- whether there are any indexes (including the primary key, unique 
constraints...) to update or not
- whether there are any foreign keys from or to that table
- the size of the rows
- whether the table (or at least the bits being updated) fit in RAM or not
- whether the table has "holes" (due to former updates/deletes and vacuum) 
and how they are placed
- and probably a bunch of other things...

Obviously, if you have an append-only (no updates, no deletes) table with 
no indexes and no foreign keys, the size of the table should not matter 
much. As soon as one of those conditions is not met table size will have an 
impact, probably small as long as whatever is needed can be held in RAM, a 
lot bigger once it's not the case.

Hope that helps,

Jacques.



In response to

Responses

pgsql-performance by date

Next:From: Andrew DunstanDate: 2005-06-27 11:45:19
Subject: Re: COPY FROM performance improvements
Previous:From: 李江华Date: 2005-06-27 11:30:50
Subject: Re: Insert performance vs Table size

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group