Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTURS-0007ur-MJ for pgsql-performance@postgresql.org; Wed, 31 Oct 2012 09:18:30 +0000 Received: from sam.nabble.com ([216.139.236.26]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TTURN-0000KX-MY for pgsql-performance@postgresql.org; Wed, 31 Oct 2012 09:18:29 +0000 Received: from [192.168.236.26] (helo=sam.nabble.com) by sam.nabble.com with esmtp (Exim 4.72) (envelope-from ) id 1TTURL-00059G-3r for pgsql-performance@postgresql.org; Wed, 31 Oct 2012 02:18:23 -0700 Date: Wed, 31 Oct 2012 02:18:23 -0700 (PDT) From: AndyG To: pgsql-performance@postgresql.org Message-ID: <1351675103112-5730140.post@n5.nabble.com> In-Reply-To: References: <508F82E1.3020202@orprovision.com> <1351608872327-5730059.post@n5.nabble.com> Subject: Re: Slow query, where am I going wrong? MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: 0.0 (/) X-Archive-Number: 201210/393 X-Sequence-Number: 48352 Albe Laurenz *EXTERN* wrote > Increasing the statistics for test_result.id_recipe_version > had no effect? > >> I am going to normalize the table some more before partitioning. > > How do you think that partitioning will help? I increased the statistics in steps up to 5000 (with vacuum analyse) - Seems to be as good as it gets. http://explain.depesz.com/s/z2a The simulated data is about a months worth. Partitioning is only really expected to help on insert, but that's pretty critical for us. At the moment test_item contains way too much repeated data IMHO, and I will address that asap (is going to hurt ). I will also look into creating an aggregate table to hold the 'distinct' values. Andy. -- View this message in context: http://postgresql.1045698.n5.nabble.com/Slow-query-where-am-I-going-wrong-tp5730015p5730140.html Sent from the PostgreSQL - performance mailing list archive at Nabble.com.