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 1jbr3Q-0007rR-Cg for pgsql-hackers@arkaria.postgresql.org; Thu, 21 May 2020 19:40:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jbr3P-00006V-57 for pgsql-hackers@arkaria.postgresql.org; Thu, 21 May 2020 19:40:31 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jbr3O-0008WR-QD for pgsql-hackers@lists.postgresql.org; Thu, 21 May 2020 19:40:30 +0000 Received: from mail-pj1-x1034.google.com ([2607:f8b0:4864:20::1034]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jbr3M-0002uj-FH for pgsql-hackers@postgresql.org; Thu, 21 May 2020 19:40:29 +0000 Received: by mail-pj1-x1034.google.com with SMTP id t8so1536694pju.3 for ; Thu, 21 May 2020 12:40:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=j-davis-com.20150623.gappssmtp.com; s=20150623; h=message-id:subject:from:to:cc:date:in-reply-to:references :mime-version:content-transfer-encoding; bh=bx+NjXg2R18GwFq4IFjwicyS3mbYmi89HTdHMmoxo0c=; b=N/5/cY4JnR9ZHWF2hxGIEwLUf8HVnai90FhB2/pwc1jTuzoEPHKydoFVu/AaL2esbi wUj0RX+FkhXm+LPWEMx3q8CvrCfso+Gcz9XMpv+dkQxWCoGjKmTxSpELDwl9EWsxDJij A/i2GlsZUfPWkhEFDPSKnNklfWpayMg4jj+S6C5LzvaFZWWJhlWtFvvwyvlwh/GsNa// 5t2J/eZP1u61WI8TtjXFKgFdPCbrKkxKHpBKGdnG6s8DUeP2K8rbcrO4ozjIRESoNHA9 w6bvxuib2CN+HJ9MzyEQ9pdImnEiWFqCZrXCQoG7vYgIcUTrPd+fVh1xiRH8jWPkF8av UbPw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:subject:from:to:cc:date:in-reply-to :references:mime-version:content-transfer-encoding; bh=bx+NjXg2R18GwFq4IFjwicyS3mbYmi89HTdHMmoxo0c=; b=MmejLbHerPAKqtAXKxdc6iGk66lJ81bcU4175IlhOt0+ORpzqDMim7pt+6lYn78lpq 2e1x8GYeN53/40EHcDoDShZ86jh+ZMsder0hJbm7CGXsoSsnIGW9fEjAagZH5W1Bmek1 tHc8aWmJ21YUsYdy/FaGHd1al2OjA24fGTli26ABLlfKCNIcA5EbvFZ+RCrAc2v6eMD/ JA0s5wl42CATKgzd55z0mrGcus9eceh8AGGmFmDD8R4m26WzGJ+3N7XYQd4/aWU3bbbf bEty0lkA4+ux37mx0J8GrmzQ/NiDyB3WwG+iuF/ef7CkaHbwvrORMMmxXusipNIHKpDI SnFQ== X-Gm-Message-State: AOAM531rDLUwY6cPVlQDNjdRmqlJSFslk/dtbtqBPzrFeLBPLPqUbYqe 7JDFobqBw6GRceazkBy8CXsP3AjrhPA= X-Google-Smtp-Source: ABdhPJy8HU3x7f5DCkvJdOulMXl1pWn+c8t8UF9jGZLE/OgE6kVzftLF6+XZwIfZC5gM0uwQhoItxQ== X-Received: by 2002:a17:90a:a62:: with SMTP id o89mr97544pjo.217.1590090027163; Thu, 21 May 2020 12:40:27 -0700 (PDT) Received: from jdavis.lan (c-73-231-146-4.hsd1.ca.comcast.net. [73.231.146.4]) by smtp.gmail.com with ESMTPSA id m63sm5264783pfb.101.2020.05.21.12.40.24 (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 21 May 2020 12:40:26 -0700 (PDT) Message-ID: Subject: Re: Trouble with hashagg spill I/O pattern and costing From: Jeff Davis To: Tomas Vondra Cc: pgsql-hackers@postgresql.org Date: Thu, 21 May 2020 12:40:23 -0700 In-Reply-To: <20200521191318.gw3xjivrxracvzmg@development> References: <20200519151202.u2p2gpiawoaznsv2@development> <88dd39d782178539d7ee46f98b98579940e2a12e.camel@j-davis.com> <20200519175320.tl4qm6le5dbg2pcf@development> <20200521191318.gw3xjivrxracvzmg@development> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5-0ubuntu0.18.04.2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Thu, 2020-05-21 at 21:13 +0200, Tomas Vondra wrote: > 1) Instead of assigning the pages one by one, we can easily extend > the > API to allow getting a range of blocks, so that we don't need to call > ltsGetFreeBlock in a loop. Instead we could call ltsGetFreeBlockRange > with the requested number of blocks. ltsGetFreeBlock() just draws one element from a minheap. Is there some more efficient way to get many elements from a minheap at once? > And we could keep just a min/max > of free blocks, not an array with fixed number of elements. I don't quite know what you mean. Can you elaborate? Regards, Jeff Davis