Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 1A7E2113F981 for ; Sat, 21 Jul 2012 16:24:39 -0300 (ADT) Received: from mail.anatec.com ([87.84.168.242]) by magus.postgresql.org with smtp (Exim 4.72) (envelope-from ) id 1SsfI4-0000iE-Qv for pgsql-performance@postgresql.org; Sat, 21 Jul 2012 19:24:38 +0000 Received: from [192.168.10.57] ([192.168.10.57]) by mail.anatec.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Sat, 21 Jul 2012 20:24:23 +0100 Message-ID: <500B01E8.1000405@anatec.com> Date: Sat, 21 Jul 2012 20:24:24 +0100 From: Ioannis Anagnostopoulos User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:14.0) Gecko/20120713 Thunderbird/14.0 MIME-Version: 1.0 To: Claudio Freire CC: Tom Lane , pgsql-performance@postgresql.org Subject: Re: A very long running query.... References: <5007FC82.9070007@anatec.com> <5009CB5A.7070801@anatec.com> <5009CD43.8000300@anatec.com> <3639.1342825802@sss.pgh.pa.us> <500B0014.5070600@anatec.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 21 Jul 2012 19:24:23.0951 (UTC) FILETIME=[6F95E9F0:01CD6776] X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201207/259 X-Sequence-Number: 47440 On 21/07/2012 20:19, Claudio Freire wrote: > On Sat, Jul 21, 2012 at 4:16 PM, Ioannis Anagnostopoulos > wrote: >> I am not sure that I can see an improvement, at least on src_id that have >> lots of msg_id per day the query never returned even 5 hours later running >> "exaplain analyze". For smaller src_id >> (message wise) there might be some improvement or it was just the analyse >> that I run. As I said the stats goes quickly out of scope because of the big >> number of updates. So it looks like that >> it is not the "funny" "where" concatenation or some kind of index >> construction problem. Which brings us back to the issue of the >> "statistics_target" on per column. My problem is that given the >> query plan I provided you yesterday, I am not sure which columns >> statistics_target to touch and what short of number to introduce. Is there >> any rule of thumb? > What's the size of your index, tables, and such? > In GB I mean, not tuples. The message_copies_wk2 that I currently hit is 13GB and 11 the Indexes, the ship_a_pos_messages_wk2 is 17GB and 2.5MB the index and the ship_objects is 150MB table and index approx. Yiannis