Re: Performance die when COPYing to table with bigint PK

From: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>
To: "Robert Ayrapetyan" <robert(dot)ayrapetyan(at)comodo(dot)com>, "Vitalii Tymchyshyn" <tivv00(at)gmail(dot)com>
Cc: <pgsql-performance(at)postgresql(dot)org>
Subject: Re: Performance die when COPYing to table with bigint PK
Date: 2011-08-02 17:41:33
Message-ID: 4E37F07D020000250003F9A7@gw.wicourts.gov
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Robert Ayrapetyan <robert(dot)ayrapetyan(at)comodo(dot)com> wrote:

> So I'm still convinced - this bug relates to FreeBSD 64-bit + UFS
> + bigint column index
> (some of these may be superfluous, but I have no resources to
> check on different platforms with different filesystems).

Linux 64 bit XFS bigint column index only shows a slightly longer
run time for bigint versus int here. What timings do you get for
the insert statements if you run the following in your environment?

create table bi (big bigint not null, medium int not null);
insert into bi with x(n) as (select generate_series(1, 1000000)
select n + 5000000000, n from x;
\timing on
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
create unique index bi_medium on bi (medium);
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
drop index bi_medium;
create unique index bi_big on bi (big);
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
truncate table bi; insert into bi with x(n) as (select
generate_series(1, 1000000)) select n + 5000000000, n from x;
\timing off
drop table bi;

Here's what I get:

Time: 1629.141 ms
Time: 1638.060 ms
Time: 1711.833 ms

Time: 4151.953 ms
Time: 4602.679 ms
Time: 5107.259 ms

Time: 4654.060 ms
Time: 5158.157 ms
Time: 5101.110 ms

-Kevin

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Merlin Moncure 2011-08-02 21:48:41 Re: Performance penalty when using WITH
Previous Message Andreas Brandl 2011-08-02 15:16:09 Re: Array access performance