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

Re: Slow Foreign Key

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br>
Cc: Sam Barnett-Cormack <s(dot)barnett-cormack(at)lancaster(dot)ac(dot)uk>,pgsql-admin(at)postgresql(dot)org
Subject: Re: Slow Foreign Key
Date: 2004-03-23 15:53:08
Message-ID: 20040323155308.GB22109@wolff.to (view raw or flat)
Thread:
Lists: pgsql-admin
On Tue, Mar 23, 2004 at 08:32:30 -0300,
  Ricardo Vaz Mannrich <rvm_l1(at)silcom(dot)com(dot)br> wrote:
> Both indexed...
> 
> But... When I try EXPLAIN SELECT * FROM detail WHERE master_id = XXXXXX;
> PostgreSQL uses seq scan (why?)

This has been discussed many times previously and if you want to understand
why things are this way search the archives.

Things will work better in 7.5.

For the time being quoting XXXXX will solve your problem as it will
allow the constant to get the same type as master_id.

In response to

pgsql-admin by date

Next:From: Josh BerkusDate: 2004-03-23 16:15:39
Subject: Re: [PERFORM] Benchmarking postgres on Solaris/Linux
Previous:From: Bruno Wolff IIIDate: 2004-03-23 15:50:41
Subject: Re: upgrading to 7.4.2

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