Re: Further thoughts about warning for costly FK checks

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Richard Huxton <dev(at)archonet(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Further thoughts about warning for costly FK checks
Date: 2004-03-17 17:15:41
Message-ID: 200403171715.i2HHFfY07961@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO wrote:
>
> > > Or maybe some new "ADVICE" or "ODDITY" level next to "DEBUG NOTICE
> > > WARNING ERROR PANIC...", that would be hidden by default and triggered
> > > by an option?
> >
> > But that doesn't really solve the problem, which is that there are
> > conditions that it's difficult to test for on-the-fly while a schema is
> > being constructed.
>
> Ok, I was off my shoes again, sorry.
>
> > A pg_advisor tool would look at the completed schema and would not have
> > that problem.
>
> Ok.
>
> As a more interesting contribution to the issue, I would suggest that such
> checks could be triggered by "ANALYSE".
>
> 1/ it is the first thing to be done on performance problems.
>
> 2/ it is not done too often.
>
> 3/ checking this stuff seems to belong to the analyse phase.
> warnings about costly foreign key checks could also be repeated
> on these occasions.
>
> Also, because of the opposition by some DBA, these checks could be disable
> by some options, but I would suggest the option to be on by default.

I was thinking of a GUC variable called PERFORMANCE_HINTS, which would
throw a message if a lookup from the primary to the foreign key didn't
have an index.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-03-17 17:20:57 Re: Constraints & pg_dump
Previous Message Josh Berkus 2004-03-17 17:12:59 Re: Constraints & pg_dump