Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 373331337B5C for ; Fri, 21 Jan 2011 14:29:11 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 17530-06 for ; Fri, 21 Jan 2011 18:29:04 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from marajade.localdomain (vcs5.camavision.com [63.228.164.252]) by mail.postgresql.org (Postfix) with ESMTP id 7FE891337B2F for ; Fri, 21 Jan 2011 14:29:03 -0400 (AST) Received: from [192.168.10.84] (unknown [192.168.10.84]) (Authenticated sender: andy) by marajade.localdomain (Postfix) with ESMTPA id 9F7F040D85; Fri, 21 Jan 2011 12:29:02 -0600 (CST) Message-ID: <4D39D07B.1070802@squeakycode.net> Date: Fri, 21 Jan 2011 12:29:15 -0600 From: Andy Colson User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Lightning/1.0b2 Thunderbird/3.1.7 MIME-Version: 1.0 To: grant@amadensor.com CC: pgsql-performance@postgresql.org Subject: Re: Fun little performance IMPROVEMENT... References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201101/200 X-Sequence-Number: 41987 On 1/21/2011 12:12 PM, grant@amadensor.com wrote: > I was doing a little testing to see how machine load affected the > performance of different types of queries, index range scans, hash joins, > full scans, a mix, etc. > > In order to do this, I isolated different performance hits, spinning only > CPU, loading the disk to create high I/O wait states, and using most of > the physical memory. This was on a 4 CPU Xen virtual machine running > 8.1.22 on CENTOS. > > > Here is the fun part. When running 8 threads spinning calculating square > roots (using the stress package), the full scan returned consistently 60% > faster than the machine with no load. It was returning 44,000 out of > 5,000,000 rows. Here is the explain analyze. I am hoping that this > triggers something (I can run more tests as needed) that can help us make > it always better. > > Idling: > QUERY PLAN > ---------------------------------------------------------------------------------------------------------------------------- > Seq Scan on schedule_details (cost=0.00..219437.90 rows=81386 width=187) > (actual time=0.053..2915.966 rows=44320 loops=1) > Filter: (schedule_type = '5X'::bpchar) > Total runtime: 2986.764 ms > > Loaded: > QUERY PLAN > ---------------------------------------------------------------------------------------------------------------------------- > Seq Scan on schedule_details (cost=0.00..219437.90 rows=81386 width=187) > (actual time=0.034..1698.068 rows=44320 loops=1) > Filter: (schedule_type = '5X'::bpchar) > Total runtime: 1733.084 ms > Odd. Did'ja by chance run the select more than once... maybe three or four times, and always get the same (or close) results? Is the stress package running niced? -Andy