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

Re: Slow Foreign Key

From: Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br>
To: Sam Barnett-Cormack <s(dot)barnett-cormack(at)lancaster(dot)ac(dot)uk>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: Slow Foreign Key
Date: 2004-03-23 11:32:30
Message-ID: 1080041550.2210.1.camel@paranagua.silcom (view raw, whole thread or download thread mbox)
Lists: pgsql-admin
Both indexed...

But... When I try EXPLAIN SELECT * FROM detail WHERE master_id = XXXXXX;
PostgreSQL uses seq scan (why?)

It's very confusing.

Em Seg, 2004-03-22 às 18:34, Sam Barnett-Cormack escreveu:
> 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?
Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br>

In response to


pgsql-admin by date

Next:From: Mike BellDate: 2004-03-23 13:47:52
Subject: Cache loolup failed problems with tsearch following pg_restore
Previous:From: CoLDate: 2004-03-23 11:06:42
Subject: Re: Databases Vs. Schemas

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