Re: Composite keys

From: Claudio Freire <klaussfreire(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Carlo Stonebanks <stonec(dot)register(at)sympatico(dot)ca>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Composite keys
Date: 2011-10-31 18:34:25
Message-ID: CAGTBQpb+HTEsJ8xFx5jjSzReS57W3t5CrcUptPwfmgj5RQiF6w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Mon, Oct 31, 2011 at 3:24 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> Sure it does:
>
> rhaas=# create table baz (a bool, b int, c text, primary key (a, b));
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "baz_pkey" for table "baz"
> CREATE TABLE
> rhaas=# insert into baz select true, g,
> random()::text||random()::text||random()::text||random()::text from
> generate_series(1,400000) g;

Ok, that's artificially skewed, since the index has only one value in
the first column.

But it does prove PG considers the case, and takes into account the
number of values it has to iterate over on the first column, which is
very very interesting and cool.

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Robert Haas 2011-10-31 18:42:09 Re: Composite keys
Previous Message Robert Haas 2011-10-31 18:24:46 Re: Composite keys