Skip site navigation (1) Skip section navigation (2)

Re: Slow Foreign Key

From: Sam Barnett-Cormack <s(dot)barnett-cormack(at)lancaster(dot)ac(dot)uk>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br>,pgsql-admin(at)postgresql(dot)org
Subject: Re: Slow Foreign Key
Date: 2004-03-22 21:34:46
Message-ID: Pine.LNX.4.58.0403222134180.2639@short.lancs.ac.uk (view raw or flat)
Thread:
Lists: pgsql-admin
On Mon, 22 Mar 2004, Tom Lane wrote:

> Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br> writes:
> > Is FOREIGN KEY so slow like that?
>
> Not normally.  Have you checked that the referencing and referenced
> columns are of the same datatype?  Have you done ANALYZE on both tables
> recently?

Other question that seems, from my experience, to be relevant - are the
referenced/referencing columns indexed?

-- 

Sam Barnett-Cormack
Software Developer                           |  Student of Physics & Maths
UK Mirror Service (http://www.mirror.ac.uk)  |  Lancaster University

In response to

Responses

pgsql-admin by date

Next:From: Tom LaneDate: 2004-03-22 22:04:50
Subject: Re: Databases Vs. Schemas
Previous:From: Subbiah, StalinDate: 2004-03-22 21:30:24
Subject: Databases Vs. Schemas

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group