Re: Performance woes

From: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
To: Benjamin Smith <lists(at)benjamindsmith(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Performance woes
Date: 2005-12-10 19:50:04
Message-ID: 20051210114807.D66479@megazone.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sat, 10 Dec 2005, Benjamin Smith wrote:

> A few questions:
>
> 1) Let's assume that I have some multipile foreign keys, and I join on three
> values. For example:
>
> Create table gangsters (
> name varchar not null,
> birthdate integer not null,
> shirtnumber integer not null,
> primary key (name, birthdate, shirtnumber);
>
> create table children (
> father_name varchar not null,
> father_bd integer not null,
> father_shirtnumber integer not null,
> birthdate integer not null,
> name varchar not null,
> foreign key (father_name, father_bd, father_shirtnumber) REFERENCES
> gangsters(name, birthdate, shirtnumber)
> );
>
> We have two table declarations, each with implicit indexes:
> 1) table gangsters has a primary_key index on name, birthdate, shirtnumber.
> 2) children has an implicit index on father_name, father_bd,
> father_shirtnumber. (right?)

AFAIK, not unless you create one.

Explain analyze output for the query would probably be useful as well.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Benjamin Arai 2005-12-10 20:27:09 Maximum number of tables per database and slowness
Previous Message Tom Lane 2005-12-10 17:59:42 Re: alter table schema in 8.0