Re: Slow Foreign Key - Mailing list pgsql-admin

From Bruno Wolff III
Subject Re: Slow Foreign Key
Date
Msg-id 20040323155308.GB22109@wolff.to
Whole thread Raw
In response to Re: Slow Foreign Key  (Ricardo Vaz Mannrich <rvm_l1@silcom.com.br>)
List pgsql-admin
On Tue, Mar 23, 2004 at 08:32:30 -0300,
  Ricardo Vaz Mannrich <rvm_l1@silcom.com.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.

pgsql-admin by date:

Previous
From: Oleg Bartunov
Date:
Subject: Re: Cache loolup failed problems with tsearch following
Next
From: "Rob Anderson"
Date:
Subject: Testing for existence of a record before insert