回复:回复:回复:A question about leakproof

From: "qiumingcheng" <qiumingcheng(at)aliyun(dot)com>
To: "Laurenz Albe" <laurenz(dot)albe(at)cybertec(dot)at>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "Julien Rouhaud" <rjuju123(at)gmail(dot)com>, "pgsql-general" <pgsql-general(at)lists(dot)postgresql(dot)org>, "yuexingzhi" <yuexingzhi(at)hotmail(dot)com>
Subject: 回复:回复:回复:A question about leakproof
Date: 2022-10-17 08:24:34
Message-ID: 195c5d95-8749-4419-a4f4-604cc8c937ec.qiumingcheng@aliyun.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

> "you seem to be imagining that changes in a query's plan on the basis of changes
> in collected statistics have something to do with this. They do not."
1. My understanding of the above paragraph is that for the same view and different users, the proleakproof=false attribute of the function will not lead to inconsistent plans, but my actual test result is that proleakproof=false will lead to inconsistent plans。
2. What's the reason about the function timestamp_gt_timestampz may cause data leakage? Can you explain how it causes data leakage?
------------------------------------------------------------------
发件人:Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
发送时间:2022年10月17日(星期一) 15:20
收件人:qiumingcheng <qiumingcheng(at)aliyun(dot)com>; Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
抄 送:Julien Rouhaud <rjuju123(at)gmail(dot)com>; pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
主 题:Re: 回复:回复:A question about leakproof
On Mon, 2022-10-17 at 13:17 +0800, qiumingcheng wrote:
> > you seem to be imagining that changes in a query's plan on the basis of changes
> > in collected statistics have something to do with this. They do not.
>
> Sorry, I may not fully understand what you mean. I mean that after my tests,
> the execution results of this SQL (explain select * from tb_a_date_v1) execution plan
> are different under different users, which is really related to the parameter proleakproof.
That's the idea behind leakproof: if a function is not leakproof, the optimizer
will not move it "inside" the view definition. Then the function is evaluated only
after the view definition. That may very well lead to a slower execution plan,
because it cannot use certain indexes on the underlying tables.
It is the price you have to pay for good security.
Yours,
Laurenz Albe

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kieran McCusker 2022-10-17 12:33:39 Fedora 37
Previous Message Laurenz Albe 2022-10-17 07:19:57 Re: 回复:回复:A question about leakproof