Hi Tom
Thanks for your quick response. I check the table ddl. There is no row-level security turn on.
There are 2 tables.
dcg.brick_base_ebr This table is partition table. And have trigger define on the table.
dcg.brick_shipment This is very simple and normal table.
I attach the table ddl for your reference.
I also attach the output about different user get different access plan for your reference.
徐志宇(Jack)
Database Engineer
DB Team,ITS. Lenovo China
Phone: 86-18910860709
Email:xuzy13@lenovo.com
No.6 Shangdi West Road, Haidian District Beijing, China, 100085
-----邮件原件-----
发件人: Tom Lane <tgl@sss.pgh.pa.us>
发送时间: 2021年5月19日 23:00
收件人: Zhiyu ZY13 Xu <xuzy13@lenovo.com>
抄送: pgsql-general@lists.postgresql.org
主题: [External] Re: PG 10 experience different user execute same sql get different access plan
Zhiyu ZY13 Xu <xuzy13@lenovo.com> writes:
> I experience a PG optimizer problem. Different user query with same SQL at same time. But get different access
plan.
If you've got row-level security turned on for that table, it could explain results like this. RLS limits the
planner'sability to see statistics, which can easily result in a worse plan.
regards, tom lane