Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)

From: Shridhar Daithankar <shridhar_daithankar(at)persistent(dot)co(dot)in>
To: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)
Date: 2003-09-29 10:34:57
Message-ID: 200309291604.57988.shridhar_daithankar@persistent.co.in
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Monday 29 September 2003 15:58, Christopher Kings-Lynne wrote:
> >>So a db designer made a bloody mistake.
> >>The problem is there's no easy way to find out what's missing.
> >>I'd really like EXPLAIN to display all subsequent triggered queries
> >>also, to see the full scans caused by missing indexes.
> >
> > It could probably be doable for EXPLAIN ANALYZE (by actually tracing
> > execution), but then you will see really _all_ queries, i.e. for a 1000
> > row update you would see 1 UPDATE query and 1000 fk checks ...
> >
> > OTOH, you probably can get that already from logs with right logging
> > parameters.
>
> Actually - it shouldn't be too hard to write a query that returns all
> unindexed foreign keys, surely?

Correct me if I am wrong but I remember postgresql throwing error that foreign
key field was not unique in foreign table. Obviously it can not detect that
without an index. Either primary key or unique constraint would need an
index.

What am I missing here?

IOW, how do I exactly create foreign keys without an index?

Shridhar

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2003-09-29 11:21:33 Re: Time problem again?
Previous Message Christopher Kings-Lynne 2003-09-29 10:28:44 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)

Browse pgsql-hackers by date

  From Date Subject
Next Message Hiroshi Inoue 2003-09-29 10:51:35 Re: pgsql-server/src/backend catalog/index.c comma ...
Previous Message Christopher Kings-Lynne 2003-09-29 10:28:44 Re: ADD FOREIGN KEY (was Re: [GENERAL] 7.4Beta)