Re: Multivariate MCV stats can leak data to unprivileged users

Поиск
Список
Период
Сортировка
От Dean Rasheed
Тема Re: Multivariate MCV stats can leak data to unprivileged users
Дата
Msg-id CAEZATCXeP6_8C_k7ai5_xGg_e0+u6f=DTATONxjftOFxK845Zg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Multivariate MCV stats can leak data to unprivileged users  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
On Sun, 19 May 2019 at 15:28, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>
> > I wonder ... another way we could potentially do this is
>
> > create table pg_statistic_ext_data(
> >     stxoid oid,  -- OID of owning pg_statistic_ext entry
> >     stxkind char, -- what kind of data
> >     stxdata bytea -- the data, in some format or other
> > );
>
> > The advantage of this way is that we'd not have to rejigger the
> > catalog's rowtype every time we think of a new kind of extended
> > stats.  The disadvantage is that manual inspection of the contents
> > of an entry would become much harder, for lack of any convenient
> > output function.
>
> No, wait, scratch that.  We could fold the three existing types
> pg_ndistinct, pg_dependencies, pg_mcv_list into one new type, say
> "pg_stats_ext_data", where the actual storage would need to have an
> ID field (so we'd waste a byte or two duplicating the externally
> visible stxkind field inside stxdata).  The output function for this
> type is just a switch over the existing code.  The big advantage of
> this way compared to the current approach is that adding a new
> ext-stats type requires *zero* work with adding new catalog entries.
> Just add another switch case in pg_stats_ext_data_out() and you're
> done.
>

This feels a little over-engineered to me. Presumably there'd be a
compound key on (stxoid, stxkind) and we'd have to scan multiple rows
to get all the applicable stats, whereas currently they're all in one
row. And then the user-accessible view would probably need separate
sub-queries for each stats kind.

If the point is just to avoid adding columns to the catalog in future
releases, I'm not sure it's worth the added complexity. We know that
we will probably add histogram stats in a future release. I'm not sure
how many more kinds we'll end up adding, but it doesn't seem likely to
be a huge number. I think we'll add far more columns to other catalog
tables as we add new features to each release.

Regards,
Dean



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

Предыдущее
От: Tomas Vondra
Дата:
Сообщение: Re: Multivariate MCV stats can leak data to unprivileged users
Следующее
От: Piotr Stefaniak
Дата:
Сообщение: Re: Emacs vs pg_indent's weird indentation for function declarations