strange index performance? - Mailing list pgsql-performance

From Thomas Finneid
Subject strange index performance?
Date
Msg-id 497AF411.1090504@fcon.no
Whole thread Raw
Responses Re: strange index performance?
Re: strange index performance?
List pgsql-performance
Hi

I just experienced a performance loss on inserts when redefining my
index on a table.

I have a database with the following table

table:
    id1    int
    id2    int
    id3    int
    id4    int
    val1    float
    ....
    tablespace dbspace

the data id distribution is hierarchical and even, well fitting to a
btree, there is about 20000 rows per insert (actually a jdbc COPY)

originally I had an index on all id felds

index:
    btree on (id1, id2, id3, id4) tablespace indexspace

that gave me an insert performance of 230 ms

because my query does not need id2 I changed the index and removed id2
from the criteria:

index:
    btree on (id1, id3, id4) tablespace indexspace

now an insert takes approx 330-430 ms

Anybody have any ideas why that is? I was expecting it to take
approximately the same amount of time or less, since there is an element
  less in the criteria.

regards

thomas



pgsql-performance by date:

Previous
From: Thomas Finneid
Date:
Subject: "tablespace" for tranaction log?
Next
From: Scott Marlowe
Date:
Subject: Re: strange index performance?