pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Sue Fitt <sue@inf.ed.ac.uk>
To: pgsql-performance@postgresql.org
Subject: setting up foreign keys
Date: Thu, 10 Aug 2006 09:05:35 +0100
Message-ID: <44DAE8CF.1030107@inf.ed.ac.uk> (raw)

Hi all,

This is my first post to the performance list, I hope someone can help me.

I'm setting up a table with 2 columns, both of which reference a column 
in another table:

CREATE TABLE headwords_core_lexemes (
core_id int REFERENCES headwords_core(core_id),
lexeme_id int REFERENCES headwords_core(core_id),
);

Trouble is, it's taken 18 hours and counting!  The table headwords_core 
only has about 13,000 lines, and core_id is the primary key on that 
table. However, I assume it must be those 13,000 lines that are the 
problem, since if I try it referencing a similar table with 360 lines 
the new table is created almost instantly.

I found a post on a similar subject from quite a while ago, but no 
answer, and that was for millions of rows anyway. I only have 13,000. 
Surely it should be faster than this? Is there a way to speed it up?

Sue Fitt




view thread (12+ messages)  latest in thread

Message-ID: <44DAE8CF.1030107@inf.ed.ac.uk>
Permalink:  ../44DAE8CF.1030107@inf.ed.ac.uk/
Also on:    postgresql.org/message-id/44DAE8CF.1030107@inf.ed.ac.uk

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: sue@inf.ed.ac.uk
  Subject: Re: setting up foreign keys
  In-Reply-To: <44DAE8CF.1030107@inf.ed.ac.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox