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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-admin by date

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