Re: Performance die when COPYing to table with bigint PK - Mailing list pgsql-performance

From Kevin Grittner
Subject Re: Performance die when COPYing to table with bigint PK
Date
Msg-id 4E37F07D020000250003F9A7@gw.wicourts.gov
Whole thread Raw
In response to Re: Performance die when COPYing to table with bigint PK  (Robert Ayrapetyan <robert.ayrapetyan@comodo.com>)
Responses Re: Performance die when COPYing to table with bigint PK  (Robert Ayrapetyan <robert.ayrapetyan@comodo.com>)
List pgsql-performance
Robert Ayrapetyan <robert.ayrapetyan@comodo.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

pgsql-performance by date:

Previous
From: Andreas Brandl
Date:
Subject: Re: Array access performance
Next
From: Merlin Moncure
Date:
Subject: Re: Performance penalty when using WITH