Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id 1E7399FB1E8 for ; Tue, 19 Jun 2007 08:10:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 92808-09-2 for ; Tue, 19 Jun 2007 08:09:50 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from silene.metacarta.com (silene.metacarta.com [65.77.47.18]) by postgresql.org (Postfix) with ESMTP id 7B5BC9FB7B4 for ; Tue, 19 Jun 2007 08:09:50 -0300 (ADT) Received: from localhost (silene.metacarta.com [65.77.47.18]) by silene.metacarta.com (Postfix) with ESMTP id 7959A14C8365; Tue, 19 Jun 2007 07:09:47 -0400 (EDT) Received: from silene.metacarta.com ([65.77.47.18]) by localhost (silene.metacarta.com [65.77.47.18]) (amavisd-new, port 10024) with ESMTP id 32040-08; Tue, 19 Jun 2007 07:09:44 -0400 (EDT) X-Auth-Received: from [192.168.1.107] (146-115-112-146.c3-0.lex-ubr1.sbo-lex.ma.cable.rcn.com [146.115.112.146]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by silene.metacarta.com (Postfix) with ESMTP id A254714C8BB3; Tue, 19 Jun 2007 07:04:22 -0400 (EDT) Message-ID: <4677B831.8060704@metacarta.com> Date: Tue, 19 Jun 2007 07:04:17 -0400 From: Karl Wright User-Agent: Thunderbird 2.0.0.4 (Windows/20070604) MIME-Version: 1.0 To: Tom Lane Cc: pgsql-performance@postgresql.org Subject: Re: Performance query about large tables, lots of concurrent access References: <4676DD57.7070304@metacarta.com> <14291.1182221811@sss.pgh.pa.us> In-Reply-To: <14291.1182221811@sss.pgh.pa.us> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at metacarta.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200706/328 X-Sequence-Number: 25361 Tom Lane wrote: > Karl Wright writes: >> - At any given time, there are up to 100 of these operations going on at >> once against the same database. > > It sounds like your hardware is far past "maxed out". Which is odd > since tables with a million or so rows are pretty small for modern > hardware. What's the CPU and disk hardware here, exactly? What do you > see when watching vmstat or iostat (as appropriate for OS, which you > didn't mention either)? > > regards, tom lane > Yes, I was surprised as well, which is why I decided to post. The hardware is a Dell 2950, two processor, dual-core each processor, 16 GB memory, with a RAID disk controller. The operating system is Debian Linux (sarge plus mods, currently using the Postgresql 8.1 backport). Also, as I said before, I have done extensive query analysis and found that the plans for the queries that are taking a long time are in fact very reasonable. Here's an example from the application log of a query that took way more time than its plan would seem to indicate it should: >>>>>> [2007-06-18 09:39:49,783]ERROR Found a query that took more than a minute: [UPDATE intrinsiclink SET isnew=? WHERE ((jobid=? AND childidhash=? AND childid=?)) AND (isnew=? OR isnew=?)] [2007-06-18 09:39:49,783]ERROR Parameter 0: 'B' [2007-06-18 09:39:49,783]ERROR Parameter 1: '1181766706097' [2007-06-18 09:39:49,783]ERROR Parameter 2: '7E130F3B688687757187F1638D8776ECEF3009E0' [2007-06-18 09:39:49,783]ERROR Parameter 3: 'http://norwich.openguides.org/?action=index;index_type=category;index_value=Cafe;format=atom' [2007-06-18 09:39:49,783]ERROR Parameter 4: 'E' [2007-06-18 09:39:49,783]ERROR Parameter 5: 'N' [2007-06-18 09:39:49,797]ERROR Plan: Index Scan using i1181764142395 on intrinsiclink (cost=0.00..14177.29 rows=5 width=253) [2007-06-18 09:39:49,797]ERROR Plan: Index Cond: ((jobid = $2) AND ((childidhash)::text = ($3)::text)) [2007-06-18 09:39:49,797]ERROR Plan: Filter: ((childid = ($4)::text) AND ((isnew = ($5)::bpchar) OR (isnew = ($6)::bpchar))) [2007-06-18 09:39:49,797]ERROR <<<<<< (The intrinsiclink table above is the "child table" I was referring to earlier, with 13,000,000 rows at the moment.) Overnight I shut things down and ran a VACUUM operation to see if that might help. I'll post again when I find out if indeed that changed any performance numbers. If not, I'll be able to post vmstat output at that time. Karl