Re: Further thoughts about warning for costly FK checks

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Bruce Momjian <pgman(at)candle(dot)pha(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-18 22:55:20
Message-ID: Pine.LNX.4.58.0403182353070.2899@sablons.cri.ensmp.fr
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Dear Tom,

I thought about it... how to solve the contradiction:
- backend vs external tool?
- new interface? new command? unix? windows?
- compatibility with old/existing interfaces?
- plugins, any one can contribute?
- don't bother DBA's
- communicate about it?

My 2 pence idea of the day (for free):

CREATE SCHEMA pg_advisor;

CREATE VIEW pg_advisor.table_without_primary_keys
AS SELECT ... FROM pg_catalog...;
COMMENT ON VIEW pg_advisor.table_without_primary_keys
IS 'hey man, it is considered better to have a primary key on tables...';

CREATE VIEW pg_advisor.costly_ri_checks
AS ...

CREATE VIEW pg_advisor.summary AS
SELECT 'missing primary key declarations', COUNT(*)
FROM pg_advisor.table_without_primary_keys
UNION
SELECT 'costly referencial integrity checks...', COUNT(*)
FROM pg_advisor.costly_ri_checks
UNION
... ;

Then:
- it is in the backend, somehow;-)
- easy plugin: CREATE VIEW ...;;-)
- anyone fluent in SQL and in pg_catalog can contribute!
- ALL existing interfaces are already compatible;-)
I can use psql;-);-)
- no one has to look at the views if he does not want to.
- you can communicate about it in the new release...
- well, we're in a relationnal database, so let us stay there;-)

Good night,

--
Fabien Coelho - coelho(at)cri(dot)ensmp(dot)fr

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Joseph Shraibman 2004-03-18 22:55:22 Will auto-cluster be in 7.5?
Previous Message Andrew Dunstan 2004-03-18 22:42:59 Re: COPY formatting