Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 90B6A1337B5C for ; Fri, 21 Jan 2011 14:16:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 20255-04 for ; Fri, 21 Jan 2011 18:16:22 +0000 (UTC) Received: from amadensor.com (amadensor.com [200.46.208.228]) by mail.postgresql.org (Postfix) with ESMTP id 6EFE71337990 for ; Fri, 21 Jan 2011 14:16:22 -0400 (AST) Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by amadensor.com (Postfix) with ESMTP id DA6CC18A4522 for ; Fri, 21 Jan 2011 18:16:21 +0000 (UTC) Received: from amadensor.com ([200.46.208.228]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 14891-02 for ; Fri, 21 Jan 2011 18:16:14 +0000 (UTC) Received: from dbms (unknown [76.76.81.70]) by amadensor.com (Postfix) with ESMTPA id 974F518A463A for ; Fri, 21 Jan 2011 18:16:12 +0000 (UTC) Received: from dbms ([127.0.0.1] helo=grant.boldlygoingnowhere.org ident=www-data) by dbms with esmtp (Exim 4.69) (envelope-from ) id 1PgLTP-0001xt-Bl for pgsql-performance@postgresql.org; Fri, 21 Jan 2011 11:12:35 -0700 Received: from 159.238.13.4 (SquirrelMail authenticated user grant) by grant.boldlygoingnowhere.org with HTTP; Fri, 21 Jan 2011 11:12:35 -0700 (MST) Message-ID: Date: Fri, 21 Jan 2011 11:12:35 -0700 (MST) Subject: Fun little performance IMPROVEMENT... From: grant@amadensor.com To: pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.15 MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Priority: 3 (Normal) Importance: Normal X-Virus-Scanned: Maia Mailguard 1.0.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.91 tagged_above=-10 required=5 tests=BAYES_00=-1.9, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201101/199 X-Sequence-Number: 41986 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