firebird icon indicating copy to clipboard operation
firebird copied to clipboard

Provide dedicated system privilege for run SET STATISTICS INDEX <table> (for non-DBA)

Open pavel-zotov opened this issue 4 years ago • 4 comments

Currently index statistics can be re-calculated only when user has system privilege for ALTERING ANY table. It seems useful to split such actions: ALTER ANY table is much powerful (and dangerous) than SET STAT INDEX which definitely can not broke nothing (except change plan for some of SQL statements - but this outcome occurs regardless who does this: SYSDBA or no).

pavel-zotov avatar Sep 08 '21 11:09 pavel-zotov

Could you split off the request for an abbreviation for set statistics to a separate issue? Thanks.

mrotteveel avatar Sep 08 '21 11:09 mrotteveel

Mark, https://github.com/FirebirdSQL/firebird/issues/6951

pavel-zotov avatar Sep 08 '21 11:09 pavel-zotov

AFAIU, you're not correct regarding ALTER ANY TABLE, it's enough to have ALTER permission for the particular table to recalculate its indices. However, I doubt such a flexibility makes sense in practice. I'd rather vote for a global privilege that affects all statistics inside the database.

dyemanov avatar Sep 08 '21 13:09 dyemanov

it's enough to have ALTER permission for the particular table to recalculate its indices For what particular table ? We have "GRANT ALTER ANY <OBJECT> TO [USER | ROLE] <user/role name> [WITH GRANT OPTION];" - i.e. this privilege relate to all existing user tables. Not for some of them. Similarly, privilege to recalculate indices statistics also can be common, for all tables.

pavel-zotov avatar Sep 08 '21 14:09 pavel-zotov