Re: Only owners can ANALYZE tables...seems overly restrictive

Поиск
Список
Период
Сортировка
Искать
От
David G. Johnston
Тема
Re: Only owners can ANALYZE tables...seems overly restrictive
Дата
Msg-id
CAKFQuwaGsNPj6vOzOaCWGz=6Lr0652jp_im76jidZzHONTd_KA@mail.gmail.com
Ответ на
Список
Дерево обсуждения
Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Stephen Frost <sfrost@snowman.net>
Re: Only owners can ANALYZE tables...seems overly restrictive "Joshua D. Drake" <jd@commandprompt.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Alvaro Herrera <alvherre@2ndquadrant.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "Joshua D. Drake" <jd@commandprompt.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Guillaume Lelarge <guillaume@lelarge.info>
Re: Only owners can ANALYZE tables...seems overly restrictive Vik Fearing <vik@2ndquadrant.fr>
Re: Only owners can ANALYZE tables...seems overly restrictive Bosco Rama <postgres@boscorama.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Guillaume Lelarge <guillaume@lelarge.info>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Stephen Frost <sfrost@snowman.net>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Adrian Klaver <adrian.klaver@aklaver.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Tom Lane <tgl@sss.pgh.pa.us>
Re: Only owners can ANALYZE tables...seems overly restrictive John R Pierce <pierce@hogranch.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Albe Laurenz <laurenz.albe@wien.gv.at>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Tom Lane <tgl@sss.pgh.pa.us>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "Joshua D. Drake" <jd@commandprompt.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Stephen Frost <sfrost@snowman.net>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive Stephen Frost <sfrost@snowman.net>
Re: Only owners can ANALYZE tables...seems overly restrictive Vitaly Burovoy <vitaly.burovoy@gmail.com>
Re: Only owners can ANALYZE tables...seems overly restrictive "David G. Johnston" <david.g.johnston@gmail.com>
On Mon, Feb 29, 2016 at 9:27 AM, Albe Laurenz <laurenz.albe@wien.gv.at> wrote:
David G. Johnston wrote:
>>>> In a production environment you don't want a user to change your table
>>>> statistics.
>>>>
>>>> They could just set default_statistics_target to something stupid,
>>>> run ANALYZE and wreck the statistics for everyone.
>>>> And then come back to the DBA and complain that things don't work.

>>> ​Setting default_statistics_target and running ANALYZE are two entirely different things.

>> Setting default_statistics_target affects the statistics computed by ANALYZE,
>> so I cannot follow you here.

> ​Just because I can run ANALYZE doesn't mean I should be able to update the statistic targets.  While
> the features are related the permissions are not.

See http://www.postgresql.org/docs/current/static/planner-stats.html

"The amount of information stored in pg_statistic by ANALYZE, in particular the
 maximum number of entries in the most_common_vals and histogram_bounds arrays
 for each column, can be set on a column-by-column basis using the
 ALTER TABLE SET STATISTICS command, or globally by setting the
 default_statistics_target configuration variable."

Being able to run ANALYZE on a table in no way implies that ​I should be allowed to run ALTER TABLE SET STATISTICS on the same.

Only table owners should be allowed to execute ALTER TABLE while, in my opinion, anyone with write capabilities on a table should be allowed to execute ANALYZE.​  I would accept a GRANT permission if that could get committed but I find the status-quo mildly annoying.

David J.

В списке pgsql-general по дате отправления
От: Joshua D. Drake
Дата:
От: Bosco Rama
Дата:
FAQ