Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1btmp4-0002YI-GX for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Oct 2016 02:29:42 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1btmp3-0006Ga-KZ for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Oct 2016 02:29:41 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1btmp1-0006F3-Lh for pgsql-hackers@postgresql.org; Tue, 11 Oct 2016 02:29:39 +0000 Received: from mail-lf0-x22b.google.com ([2a00:1450:4010:c07::22b]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1btmoy-0006M3-24 for pgsql-hackers@postgresql.org; Tue, 11 Oct 2016 02:29:38 +0000 Received: by mail-lf0-x22b.google.com with SMTP id x79so15726593lff.0 for ; Mon, 10 Oct 2016 19:29:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=IIvPUKg00pT30ug+OMWkdWpQRvWd2wDSEZ3o3Sv2U8g=; b=d6bBL/wrmkC49FUOjN5zkbYhLJYWuG/9EGdCTmxLHRKqQt/nnxApb0+PGPFlYlT/5g khjJX9t3G8/ej1fhzON5DsRMzSIauqGr3S1OsJgRfm7tyG/HtZ+IljECR9dhiG/xla7D RZygwOKExpMh6AANIjJGThosXlyD6Tmo5c5usUGBIenCT++PK+9zq1rsw+v8AWmSVS+W iEdbkOZRraHy+gDYXceivNhQmsLTpHanGTWCcRL1ee+WKxUu4Gyyo/IzVmzz6K9y4uQy I6RM80L87xykQSVhX6BjA9Rq7c022QtLZJRZP7w4JB7rZie8QLaZSsKzD7snjfTWgDV1 TZsw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=IIvPUKg00pT30ug+OMWkdWpQRvWd2wDSEZ3o3Sv2U8g=; b=MloQ+AIqeENytt+4GMXNeFNznCDBd4+QyAqKs5ogP+LrAWrCXX/k/vzdhRrfeGvPQ3 5KGtwUiJmVj85wl0QmS5NeDUCevuuF73rfKrGBm36d5EJWZOHUaRzCtZSqEWI9NSweWE 7IltCVjFF+OcawthN8eaYAhZTEo+0387c06yZcqphy8axdGouaz1SIQ1eAcc8vgvhdm1 GLuGOXAzQJS2i67UFfyN8bWqAYjN525zLHLg8dmuOhCGlT0CWDgqE0VsLGmJt8VCJoaL izjeYqxFST8sW1wjjVGt73IRU8wiFiGUsKg53EOPlr2PWtUlCmsn/MShwNvYj4Y40vGd 1Ezw== X-Gm-Message-State: AA6/9Rl8rFNDTdo8fEZ2bo5ic37X+i1QxVNzcWx3dLIRelPXxOHvR0N3KEOTHVazh5SEZaYpgWuC/eTGq6ml7Tt7cxBnpNog3QdNgS0zV1ayEJjqJx1heONsgjowuma3sa0L+9hdI03L+xO9Y4qF1nRR2MRFR5YdUMCUJtEDMRz2s2DofkTZ3fztP6WZVLFw4cI5cqzp/s5+ X-Received: by 10.194.44.226 with SMTP id h2mr1439649wjm.113.1476152974817; Mon, 10 Oct 2016 19:29:34 -0700 (PDT) Received: from [10.137.2.17] (ip-89-177-44-58.net.upcbroadband.cz. [89.177.44.58]) by smtp.gmail.com with ESMTPSA id 17sm1864499wju.44.2016.10.10.19.29.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Oct 2016 19:29:34 -0700 (PDT) Subject: Re: Macro customizable hashtable / bitmapscan & aggregation perf To: Andres Freund References: <20160727004333.r3e2k2y6fvk2ntup@alap3.anarazel.de> <20161001004454.4wkqbmu67spvc3ak@alap3.anarazel.de> <41a178d4-a599-60e6-1657-e2489508858a@2ndquadrant.com> <20161001195956.u657cbvya7thzkr6@alap3.anarazel.de> <0b71d15b-89ef-bd4f-d653-0a118b550601@2ndquadrant.com> <20161002001758.GA14611@awork2> <20161009233803.6zjackpbz2v2s4sw@alap3.anarazel.de> <64bb428d-8e05-9130-5627-fac7e85a68aa@2ndquadrant.com> <20161011004622.5kkvlwghm4yvg4id@alap3.anarazel.de> <20161011020751.o2ozug266i5vx7pt@alap3.anarazel.de> Cc: pgsql-hackers@postgresql.org From: Tomas Vondra Message-ID: <4c78c42c-8259-4d15-1a4f-df17878e8e1b@2ndquadrant.com> Date: Tue, 11 Oct 2016 04:29:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:46.0) Gecko/20100101 Thunderbird/46.0a2 MIME-Version: 1.0 In-Reply-To: <20161011020751.o2ozug266i5vx7pt@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 10/11/2016 04:07 AM, Andres Freund wrote: > On 2016-10-10 17:46:22 -0700, Andres Freund wrote: >>> TPC-DS (tpcds.ods) >>> ------------------ >>> >>> In this case, I'd say the results are less convincing. There are quite a few >>> queries that got slower by ~10%, which is well above - for example queries >>> 22 and 67. There are of course queries that got ~10% faster, and in total >>> the patched version executed more queries (so overall the result is slightly >>> positive, but not significantly). >> >> That's interesting. I wonder whether that's plan changes just due to the >> changing memory estimates, or what's causing that. I'll look into it. > > Hm. Based on an initial look those queries aren't planned with any of > the affected codepaths. Could this primarily be a question of > randomness? Would it perhaps make sense to run the tests in a comparable > order? Looking at tpcds.py and the output files, it seems that the query > order differes between the runs, that can easily explain bigger > difference than the above. For me a scale=1 run creates a database of > approximately 4.5GB, thus with shared_buffers=1GB execution order is > likely to have a significant performance impact. > Yes, I see similar plans (no bitmap index scans or hash aggregates). But the difference is there, even when running the query alone (so it's not merely due to the randomized ordering). I wonder whether this is again due to compiler moving stuff around. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers