pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Jan Michel <Jan@mueschelsoft.de>
Cc: Jeff Janes <jeff.janes@gmail.com>
Cc: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: One query run twice in parallel results in huge performance decrease
Date: Fri, 29 Nov 2013 18:48:07 -0500
Message-ID: <21793.1385768887@sss.pgh.pa.us> (raw)
In-Reply-To: <52991D59.9050100@mueschelsoft.de>
References: <5299103F.1040307@mueschelsoft.de>
	<CAMkU=1wyY0BCkae12-kn=hAg81TJi2Yz+9WHvPfruzzUvxbazg@mail.gmail.com>
	<52991D59.9050100@mueschelsoft.de>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>

Jan Michel <Jan@mueschelsoft.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


-- 
Sent via pgsql-performance mailing list (pgsql-performance@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance



view thread (8+ messages)  latest in thread

Message-ID: <21793.1385768887@sss.pgh.pa.us>
Permalink:  ../21793.1385768887@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/21793.1385768887@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: tgl@sss.pgh.pa.us, Jan@mueschelsoft.de, jeff.janes@gmail.com
  Subject: Re: One query run twice in parallel results in huge performance decrease
  In-Reply-To: <21793.1385768887@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox