Hi Admin support I experience a PG optimizer problem. Different user query with same SQL at same time. But get different access plan. On the test env: PG 10.3 env. User: ccfuser. This user is DB owner. It will get result within 3 second.
The totally cost is : 99672 User: a_app. This is normal user . It will get result after take 15 minutes.
The totally cost is : 52784 The table has been analyze and vacuum. dcg.brick_base_ebr dcg.brick_shipment I don’t know which factor impact the access plan. This problem could reproduced.
If I grant superuser to a_app. a_app execute sql will using same access plan with ccfuser.
If I revoke superuser from a_app . It will back to original access plan.
Would you like to give me any advice about this issue ? Thanks for your help.
The SQL is :
The ccfuser access plan:
The a_app access plan:
徐志宇(Jack) Database Engineer
DB Team,ITS. Lenovo China
Phone: 86-18910860709
Email:xuzy13@xxxxxxxxxx
No.6 Shangdi West Road, Haidian District Beijing, China, 100085 |