Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2l9T-006whE-2u for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Oct 2024 05:40:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1t2l9R-004h1Q-CZ for pgsql-hackers@arkaria.postgresql.org; Mon, 21 Oct 2024 05:40:21 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1t2l9R-004h1I-2T for pgsql-hackers@lists.postgresql.org; Mon, 21 Oct 2024 05:40:21 +0000 Received: from mail-ej1-x62d.google.com ([2a00:1450:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1t2l9P-002AMK-IF for pgsql-hackers@postgresql.org; Mon, 21 Oct 2024 05:40:20 +0000 Received: by mail-ej1-x62d.google.com with SMTP id a640c23a62f3a-a9a26a5d6bfso600558966b.1 for ; Sun, 20 Oct 2024 22:40:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1729489218; x=1730094018; darn=postgresql.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KA4yAveH8aiP+UE3MYszHWA0AjgEdHE+fvPOOuAv1wQ=; b=Zsjrn9eCHBqp2Wh9Er0S22hACmEWoqSHGYFmgO41NVmpysIU2Kh6s52WTi86FwwCSl cFQ0w4RkdSMYBKK3iv13MM6ZvqqHj7oMxPKvebfILpUNbVetXYFz41kq6Pv7n2hVBnoS VkS05ljAyoXsRD/cRFR1dPLv4mASXEMa5Uutp2+wSz8R9vlGoiKk8KjQmfyq+aWjqCn4 NEgdd1uZs84To7fsR3LpnweL+6oXpOV24vMnVwiUn7WpXDI4HogGQS6hmfZvPxtQnfrQ jv2vxN9zFs2uGTNSSNEvNLziNOCz/2HCJyK9WxBDzbhvMh/TXflURm/SeD7eG+QvsvOn lArg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729489218; x=1730094018; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KA4yAveH8aiP+UE3MYszHWA0AjgEdHE+fvPOOuAv1wQ=; b=cq8DVxIj+Q8s4+x2Pfq1v2hHw5x1qzb4v9VvF4iEtpr3udWSzBLLZxjQzG8CIB5N5u 8ymtcZ8Ad/sDvjh6R4Er+nw0AMi52wMCMm1gMi5cmo9nM/Qbp1H2CL7OsJQpkAJ0Djm2 GOB+3HYhqL59hmLRakskcruUIfvBkn8m0h1M6XiXf9KWBPTw232fFnIKPwg9AK03Pvgn KvLbMxLmxiYgLVaIXx5NRxPWCmzZ8XFJOkCj9yvp2f4LdVslap+s6DCUuLHuxH1D7+mZ iV+LmlRW60WWzZd7/kfGZrzHUuHw1KypMpdTy8mI19P/4DIzD0YtSeDp7RmrTVXYIMl4 2sww== X-Forwarded-Encrypted: i=1; AJvYcCWyFO5uPFbwrEomfN5baSrHim3LwDOL/Nk2XeDDO92Koe/WDnxoMtF1s4/ePY8KQ0xgWcWZAM/3hdER1ujO@postgresql.org X-Gm-Message-State: AOJu0YxCtX0Tw7bCfGsT36zRAqBWYH27bLRt1V4o0jX9eRQ/eLU0bnJf rgr4/X/ctQEIDA8jUbbOWzwzh6uWVzaT0kzT7osFCzZz74fIuNTO X-Google-Smtp-Source: AGHT+IEiERIWyBfIij19Wv+/Iw+G3XdjZmnoOpbqASTS3Mn1PFyGDPw/NVCWPuPg4r7bi0NUTRdYWw== X-Received: by 2002:a17:906:730d:b0:a99:ebbb:1307 with SMTP id a640c23a62f3a-a9a69de9af8mr1117895666b.59.1729489218210; Sun, 20 Oct 2024 22:40:18 -0700 (PDT) Received: from [20.10.0.61] ([5.182.58.202]) by smtp.gmail.com with ESMTPSA id a640c23a62f3a-a9a912d6267sm162473766b.32.2024.10.20.22.40.15 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 20 Oct 2024 22:40:17 -0700 (PDT) Message-ID: Date: Mon, 21 Oct 2024 09:40:14 +0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: type cache cleanup improvements To: =?UTF-8?Q?Dagfinn_Ilmari_Manns=C3=A5ker?= , Alexander Korotkov Cc: jian he , Artur Zakirov , Alexander Lakhin , Pavel Borisov , Teodor Sigaev , Pgsql Hackers , Aleksander Alekseev , Tom Lane , Michael Paquier References: <8613a1d1-e19c-41fc-8b9d-efc62d63fc17@gmail.com> <57fe476a-01c1-452e-ad0a-8eb49123bd28@gmail.com> <87y12i8i6f.fsf@wibble.ilmari.org> Content-Language: en-US From: Andrei Lepikhov In-Reply-To: <87y12i8i6f.fsf@wibble.ilmari.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 21/10/2024 06:32, Dagfinn Ilmari Mannsåker wrote: > Alexander Korotkov writes: > >> +static Oid *in_progress_list; >> +static int in_progress_list_len; >> +static int in_progress_list_maxlen; > > Is there any particular reason not to use pg_list.h for this? Sure. The type cache lookup has to be as much optimal as possible. Using an array and relating sequential access to it, we avoid memory allocations and deallocations 99.9% of the time. Also, quick access to the single element (which we will have in real life almost all of the time) is much faster than employing list machinery. -- regards, Andrei Lepikhov