Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1f1XAb-0004X4-3v for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Mar 2018 13:00:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1f1XAa-00067K-5r for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Mar 2018 13:00:44 +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.89) (envelope-from ) id 1f1XAZ-00067A-Q7 for pgsql-hackers@lists.postgresql.org; Thu, 29 Mar 2018 13:00:43 +0000 Received: from mail-wm0-x231.google.com ([2a00:1450:400c:c09::231]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1f1XAV-0004lE-7M for pgsql-hackers@postgresql.org; Thu, 29 Mar 2018 13:00:43 +0000 Received: by mail-wm0-x231.google.com with SMTP id x4so11394366wmh.5 for ; Thu, 29 Mar 2018 06:00:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=18J+EKMWUl9Y2dCBGEJ8s9dTkG9awY+tRru7YUuho+k=; b=dIK0s4ipTylTnZAwDW/1wmc6oRyAuA8FhJ/dOhEcScy1XuPVuejmyrG3ryxxqRpQx+ wq1WZs/WIhLdwH+kAY6UMe9/6bmIfcZVM4r2+q+LYaV+CriUhz/oVci/mtjgNtmkz8be YelGcSVgzd8A1occFZuvzkseZUq4gMuFBO3Dn3cuTK799G7HtK1VLRIKlhts8WBePOCw +CQM7vOVHgUK/X0JJUM74HluXgpfCfLNmw3Q/1vkkQN/GhW2UpQla5ptL7zIUacPmMc+ zpkmYMZflza2eF3Wc2XRrdnJIwyiZgZjx2ZUJNrUgFaC+L/nKCd05zi+NY1HFjrXYHXB NZaQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=18J+EKMWUl9Y2dCBGEJ8s9dTkG9awY+tRru7YUuho+k=; b=Ci7hGbskvb2l9skIni3vS+O1qMbISFscDc9WvnVHH6eeR9htQ4emVlLHK7Su7EYF/j vFaDgWmRC4zhCQHs78tc+4/5NLBjt25fEzB5oqGHZD9eVGy73rzMa46+zb66MFFCEJUb UNpfpcGmrNJCUaO+IK4Ri51qGTQaSGwfvMDWMfnXbFDpJWL2qjIu09DPh59v/Y8GMTtM bvyaaJ4zdZrIX1UKmEtoSmLDe6xiItDepy4DTPlsA3zSYwqcJntvWxp19SuZ1Ti35DgD hRwU5nwJq1dJ75Sn3h7w2B63nXcdUEcYcDOD1eZNByuS/G416cMsHX4VJmDSkuONvdXp ol7Q== X-Gm-Message-State: AElRT7EMKs3a7pX9kTQHNlVRaIERgp17xq7wYKRR5mPqYxvSg5pBTW24 Y0+CTyohIF/V3KXOdEAtpRQYsPxO2iSsOtrtNiycIOeT8FZAjVWVVqpT0UU3Me0Sf8GgAyW244q fQ4kWnq5S3YF+x/AuTGWKG65+8/rLx+bpVeD7fwlRZKljjaAF7ClLrpR+whk/CbafLaE6UTGj0Z JvtLFgh2b/M44= X-Google-Smtp-Source: AIpwx48UHNG0ZytyApNuJc7O+2bZbMxuMtjAkWkmuAZ9hLRkdpjwSdDO6ty3UXZj4ia8hRCff5MZcg== X-Received: by 10.28.30.85 with SMTP id e82mr5809698wme.67.1522328437141; Thu, 29 Mar 2018 06:00:37 -0700 (PDT) Received: from [10.137.2.17] ([212.24.157.174]) by smtp.gmail.com with ESMTPSA id m71sm1739687wmd.6.2018.03.29.06.00.36 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 29 Mar 2018 06:00:36 -0700 (PDT) Subject: Re: Parallel Aggregates for string_agg and array_agg To: David Rowley Cc: Tom Lane , Stephen Frost , Andres Freund , PostgreSQL-development References: <1b6ee15c-c218-761e-0120-c1ed438e2db2@2ndquadrant.com> <657be73a-a21d-0ae1-5c62-870afbdfddd4@2ndquadrant.com> <20180326022647.GL24540@tamriel.snowman.net> <20180326132009.GN24540@tamriel.snowman.net> <6538.1522096067@sss.pgh.pa.us> <25812.1522108164@sss.pgh.pa.us> <19216.1522207699@sss.pgh.pa.us> <18741.1522245278@sss.pgh.pa.us> <1ffa699d-ff84-4c21-10cb-4d8b36017bab@2ndquadrant.com> From: Tomas Vondra Message-ID: <13e3fd13-8152-72be-4e3c-8095e6ec0995@2ndquadrant.com> Date: Thu, 29 Mar 2018 15:00:34 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 03/29/2018 05:49 AM, David Rowley wrote: > On 29 March 2018 at 03:05, Tomas Vondra wrote: >> On 03/28/2018 03:54 PM, Tom Lane wrote: >>> I had in mind to look at exprType() of the argument. >> >> Right, I'm fine with that. > > Attached is v9, which is based on Tom's v8 but includes the new tests > and I think the required fix to disable use of the serial/deserial > function for array_agg(). > I have only looked at the diff, but it seems fine to me (in the sense that it's doing the right checks to disable parallelism only when really needed). FWIW I wonder if we might simply fallback to input/output functions when the send/receive functions are not available. Not sure it's worth it. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services