7

After restoring db-server from snapshot something strange started happening with our database. Basically it can be described as all time-consuming queries are seems to be duplicated. At least as pg_stat_activity shows it

select from pg_stat_activity with only active queries shown

These lines are almost equal except for their PIDs and client addresses.

Usually I'd think that that's just a mistake of dev team (multiple equal queries at a time in code, cron misconfiguration, etc), but one of those time-consuming selects comes from PowerBI which I believe to be quite reliable in terms of loading data.

Has anybody ever stumbled upon this problem?

3
  • pg_stat_statements does bot record a client IP address. The problem must be with your query (that you didn't disclose). Commented Jun 30, 2021 at 5:56
  • Postgres does not just run statements "out of the blue". If you see the same statement being run repeatably your application(s) are doing that. You need to look there. Maybe the end-users simply hit "refresh" in PowerBI all the time and thus the query is run over and over again. It's certainly not caused by Postgres itself. Commented Jun 30, 2021 at 6:05
  • Turned out to be neither of those. That's the way pg_stat_activity shows parallel workers processing single query. Commented Jun 30, 2021 at 7:31

1 Answer 1

10

Turned out that's the way pg_stat_activity shows parallel workers processing single query. You can make sure that's the case by getting backend_type of these records.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.