Re: Simple postgresql.conf wizard

From: "Robert Haas" <robertmhaas(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: "Kevin Grittner" <Kevin(dot)Grittner(at)wicourts(dot)gov>, jd(at)commandprompt(dot)com, "Josh Berkus" <josh(at)agliodbs(dot)com>, "Greg Smith" <gsmith(at)gregsmith(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Simple postgresql.conf wizard
Date: 2008-12-06 04:25:39
Message-ID: 603c8f070812052025h11d73113ga583c195cb146ad8@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

I profiled this on CVS HEAD. First, I set this up:

> postgres=# create table tk as select random()::text||random()::text||random()::text||random()::text||random()::text||random()::text as r from generate_series(1,1000);
> postgres=# insert into tk (select * from tk);
> postgres=# insert into tk (select * from tk);
> postgres=# insert into tk (select random()::text||random()::text||random()::text||random()::text||random()::text||random()::text as r from generate_series(1,2000));
> postgres=# alter table tk alter r set statistics 1000;
> postgres=# analyze tk;

Then I profiled a backend that executed the following query 10x
(uparrow-enter 10 times from psql):

> postgres=# explain select count(*) from (select * from tk as k, tk as l,tk as m,tk as n,tk as o,tk as p where k.r=l.r and k.r=m.r and k.r=n.r and k.r=o.r and k.r=p.r) as x;

Results:

% cumulative self self total
time seconds seconds calls s/call s/call name
77.73 1.92 1.92 5500 0.00 0.00 pglz_decompress
6.07 2.07 0.15 250 0.00 0.00 eqjoinsel
1.62 2.11 0.04 2009500 0.00 0.00 varstr_cmp
1.21 2.14 0.03 3502500 0.00 0.00 datumCopy
1.21 2.17 0.03 3500 0.00 0.00 deconstruct_array
1.21 2.20 0.03 MemoryContextContains

Full results attached.

...Robert

Attachment Content-Type Size
gmon.txt.bz2 application/x-bzip2 53.8 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2008-12-06 04:29:10 Re: BUG #4566: pg_stop_backup() reports incorrect STOP WAL LOCATION
Previous Message Robert Treat 2008-12-06 04:16:24 Re: default statistics target testing (was: Simple postgresql.conf wizard)