pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Jan Michel <Jan@mueschelsoft.de>
To: pgsql-performance@postgresql.org <pgsql-performance@postgresql.org>
Subject: Re: One query run twice in parallel results in huge performance decrease
Date: Tue, 03 Dec 2013 21:18:39 +0100
Message-ID: <529E3C9F.8070101@mueschelsoft.de> (raw)
In-Reply-To: <CAMkU=1xQc9oYLA8pRM3mRBA11ogdmd1q7Veq=iSk2g29hMJjTQ@mail.gmail.com>
References: <5299103F.1040307@mueschelsoft.de>
	<CAMkU=1wyY0BCkae12-kn=hAg81TJi2Yz+9WHvPfruzzUvxbazg@mail.gmail.com>
	<52991D59.9050100@mueschelsoft.de>
	<CAMkU=1xQc9oYLA8pRM3mRBA11ogdmd1q7Veq=iSk2g29hMJjTQ@mail.gmail.com>
List-Unsubscribe:  <mailto:majordomo@postgresql.org?body=unsub%20pgsql-performance>


Jeff Janes wrote:
> I think what I would do next is EXPLAIN (without ANALYZE) one of the 
> queries repeatedly, say once a second, while the other query either 
> runs or doesn't run repeatedly, that is the other query runs for 11 
> minutes (or however it takes to run), and then sleeps for 11 minutes 
> in a loop.  Then you can see if the explain plan differs very 
> reliably, and if the transition is exactly aligned with the other 
> starting and stopping or if it is offset.

Hi Jeff,
I ran the one analyze over and over again as you proposed - but the 
result never changed.
But I think I found a solution for the problem. While browsing through 
the manual I found a statement about GIN indexes:
"For tables with GIN indexes, VACUUM (in any form) also completes any 
pending index insertions, by moving pending index entries to the 
appropriate places in the main GIN index structure". I use a gist and no 
gin index, but I tried to vacuum the (freshly filled) table, and it 
helped. It seems that the planer is simply not aware of the existence of 
the index although I run an analyze on the table right before the query.

Thank you all for your suggestions!
Jan

view thread (8+ messages)

Message-ID: <529E3C9F.8070101@mueschelsoft.de>
Permalink:  ../529E3C9F.8070101@mueschelsoft.de/
Also on:    postgresql.org/message-id/529E3C9F.8070101@mueschelsoft.de

 · 

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: Jan@mueschelsoft.de
  Subject: Re: One query run twice in parallel results in huge performance decrease
  In-Reply-To: <529E3C9F.8070101@mueschelsoft.de>

* 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