Re: One query run twice in parallel results in huge performance decrease

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Jan Michel <Jan(at)mueschelsoft(dot)de>
Cc: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>, "pgsql-performance(at)postgresql(dot)org" <pgsql-performance(at)postgresql(dot)org>
Subject: Re: One query run twice in parallel results in huge performance decrease
Date: 2013-11-29 23:48:07
Message-ID: 21793.1385768887@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Jan Michel <Jan(at)mueschelsoft(dot)de> writes:
> All tables are generated freshly from scratch by the same script only
> minutes before this query is run. I tested them all individually and
> never saw any problem, all use the same plan. As soon as I run two in
> parallel it happens. I also did a test by feeding two tables with
> identical data - again the same problem.

Hm. Are you explicitly ANALYZE'ing the newly-built tables in your script,
or are you just trusting auto-analyze to get the job done? It seems
possible that auto-analyze manages to finish before you start your big
query if there's just one set of tables to analyze, but not if there's two
sets. That would explain bad choices of plans ...

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Jan Michel 2013-11-30 11:05:47 Re: One query run twice in parallel results in huge performance decrease
Previous Message Jan Michel 2013-11-29 23:03:53 Re: One query run twice in parallel results in huge performance decrease