Re: Further thoughts about warning for costly FK checks

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: Further thoughts about warning for costly FK checks
Дата
Msg-id Pine.LNX.4.58.0403182353070.2899@sablons.cri.ensmp.fr
обсуждение исходный текст
Ответ на Re: Further thoughts about warning for costly FK checks  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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
aboutit?
 


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
hedoes not want to.- you can communicate about it in the new release...- well, we're in a relationnal database, so let
usstay there;-)
 

Good night,

-- 
Fabien Coelho - coelho@cri.ensmp.fr


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Andrew Dunstan
Дата:
Сообщение: Re: COPY formatting
Следующее
От: Jon Jensen
Дата:
Сообщение: Re: Authentication drop-down?