Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jopab-0005b3-S5 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2020 14:44:25 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jopaa-0000ML-J1 for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jun 2020 14:44:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jopaa-0000MB-Bk for pgsql-hackers@lists.postgresql.org; Fri, 26 Jun 2020 14:44:24 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jopaV-00008L-5I for pgsql-hackers@postgresql.org; Fri, 26 Jun 2020 14:44:21 +0000 Received: by mail-ej1-x633.google.com with SMTP id mb16so9649968ejb.4 for ; Fri, 26 Jun 2020 07:44:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=TbdsJWgCRXg6cJDfLfIkACoP7fjVWcJfHRSHrMChlzU=; b=nGGzYu3M4vfKsWI+EVEwjTEXU9frrK17XXFPTH7QhBPqnJaHzeRb6R2GrkkRZGGlqr uSQ3rYc8BYS84xcdMHxG1KqKEfZJa+PyeSfBGoVb/GcVDSuKULP5QcwHpL0nDcpTexhJ SCysVj5ANzrWKQn6CS+iYzTtcqu8pjN/SIwdzKgUAOfuNAFvPKQba1naW4eEGCtg84lB rL6WgTxubaa0G19kbCrZ4BcA/DLKqFG9Sis0uvtaBbq54cdmF5eZFerzeMqGZV9cZmEp +YlWa1PKUr4ojjcSnmd0kzSk0TRz92carS4aEFlO6nQw8v1cNjRJZ9onkY+5P3kfB4qW rNJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=TbdsJWgCRXg6cJDfLfIkACoP7fjVWcJfHRSHrMChlzU=; b=l3LOqy+x2vtjkHsyR9ryJI79PdbREl/UFaHWKSPb1XO7L8ynACqwB78diiDEliBcc6 Dlb0zba4JO21EtKlZWXg28ri/Mmfre/uUNg0LbX28XlZ8bfp5F9IA9LpSvBdYnd1Tcaw yKXKsPQuCZMCmX3Gx/a/c4god4D+CJUaJ2PF7i4ZMbACbao45ABGNtXTGeGao8rYTWmw ltuTI5wrgYs22sKLPyLdoMhrK8fZaEiH3d/FzqfFpgou6bjzWzMnB+XHAlLHZAGyDSOU HF5yY8KWCKDNiFri6+UhphqWwuSWvcXuayvwBQ/wb1mrxdtmVDkiYFwOaZdxJOXxwJPU DlYg== X-Gm-Message-State: AOAM533gll6V+K3BKD30bqAlgF5H1IsMOg788o5bBcdE6t11ouj24EHP Zcu9U0KCW8ujonmZTcA7a2/G7w== X-Google-Smtp-Source: ABdhPJx+1v44HocmqWPhoKDiZcjxHy3kbVmjXnGGWnP6BfIrWwHPDMHISZamRkkjt/aeq00ZJ8u/CQ== X-Received: by 2002:a17:906:1ed2:: with SMTP id m18mr2762686ejj.529.1593182657973; Fri, 26 Jun 2020 07:44:17 -0700 (PDT) Received: from localhost (ip-86-49-253-141.net.upcbroadband.cz. [86.49.253.141]) by smtp.gmail.com with ESMTPSA id y6sm1561641eds.87.2020.06.26.07.44.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Jun 2020 07:44:16 -0700 (PDT) Date: Fri, 26 Jun 2020 16:44:14 +0200 From: Tomas Vondra To: Bruce Momjian Cc: Robert Haas , Andres Freund , David Rowley , Jeff Davis , Justin Pryzby , Melanie Plageman , "pgsql-hackers@postgresql.org" Subject: Re: Default setting for enable_hashagg_disk Message-ID: <20200626144414.rftlidu34rigiulv@development> References: <20200624090628.GA19640@momjian.us> <20200624171203.GB17842@momjian.us> <20200624191900.t4sbfk236gndwoa3@alap3.anarazel.de> <20200624231810.GB13627@momjian.us> <20200624233837.GA21436@momjian.us> <20200625171756.GB12486@momjian.us> <20200625235357.udlest4k6i2uekui@development> <20200626040210.GA13963@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: <20200626040210.GA13963@momjian.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Fri, Jun 26, 2020 at 12:02:10AM -0400, Bruce Momjian wrote: >On Fri, Jun 26, 2020 at 01:53:57AM +0200, Tomas Vondra wrote: >> I'm not saying it's not beneficial to use different limits for different >> nodes. Some nodes are less sensitive to the size (e.g. sorting often >> gets faster with smaller work_mem). But I think we should instead have a >> per-session limit, and the planner should "distribute" the memory to >> different nodes. It's a hard problem, of course. > >Yeah, I am actually confused why we haven't developed a global memory >allocation strategy and continue to use per-session work_mem. > I think it's pretty hard problem, actually. One of the reasons is that the costing of a node depends on the amount of memory available to the node, but as we're building the plan bottom-up, we have no information about the nodes above us. So we don't know if there are operations that will need memory, how sensitive they are, etc. And so far the per-node limit served us pretty well, I think. So I'm not very confused we don't have the per-session limit yet, TBH. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services