zubkov-andrei / pg_profile

Postgres historic workload reports
Other
212 stars 31 forks source link

SELECT take_sample(); ISSUE #37

Closed gael-efluid closed 1 year ago

gael-efluid commented 2 years ago

Hello, After migrating my PG Instance from V13 to V14, I'm facing an issue when taking a sample : take_sample_issue

I checked and the table sample_statements is empty : image

Here are the extension on my instance : image

I tried to DROP the EXTENSIONs related to pg_profile, then restart the instance, then reinstall them, but I still got the issue.

Do you have any idea on what's going on ?

Kind regards, Gaël

zubkov-andrei commented 2 years ago

Hi, @gael-efluid I think it is a bug. I wonder that it is detected only now. It seems you've catched a query that can be executed as top-level query and as nested-level. And both are heavy enough to be saved in a sample. sample_statements PK is defined incorrectly and can't handle this. I'll fix it in next release. Right now you can disable collection of nested-level statement statistics setting pg_stat_statements.track to 'top'. Ypu'll need to reset pg_stat_statements also. Obviously you won't see nested-level statistics than. It only will be accounted in top-level statements.

gael-efluid commented 2 years ago

Hello, I did your workaround and I can now take snapshots :) Thanks a lot!

When do you think next release will be available ?

Kind regards,

zubkov-andrei commented 2 years ago

I think it should happen during a month or so...

Thank you for a report!

zubkov-andrei commented 1 year ago

Thanks again. Fix included in release 4.0