Re: Why the planner is not using the INDEX .

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: David Gagnon <dgagnon(at)siunik(dot)com>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: Why the planner is not using the INDEX .
Date: 2005-07-05 01:13:30
Message-ID: 42C9DEBA.4000905@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

> I'm a bit surprised of that behavior thought, since it means that if we
> delete a row from table A all tables (B,C,D) with FK pointing to this
> table (A) must be scanned.
> If there is no index on those tables it means we gone do all Sequantial
> scans. Than can cause significant performance problem!!!.

Correct.

> Is there a reason why implicit index aren't created when FK are
> declared.

Because it's not a requirement...

> I looked into the documentation and I haven't found a way to
> tell postgresql to automatically create an index when creating la FK.
> Does it means I need to manage it EXPLICITLY with create index statement
> ? Is there another way ?

No other way - you need to explicitly create them. It's not that hard
either to write a query to search the system catalogs for unindexed FK's.

Chris

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Bruno Wolff III 2005-07-05 12:32:17 Re: Why the planner is not using the INDEX .
Previous Message David Gagnon 2005-07-05 00:29:50 Re: Why the planner is not using the INDEX .