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 1syNn0-00GLzL-2P for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Oct 2024 03:55:06 +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 1syNmy-00DblW-Nn for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Oct 2024 03:55:04 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1syNmy-00DblO-Db for pgsql-hackers@lists.postgresql.org; Wed, 09 Oct 2024 03:55:04 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1syNmw-003FSK-5L for pgsql-hackers@lists.postgresql.org; Wed, 09 Oct 2024 03:55:03 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-2e2b159c609so45349a91.2 for ; Tue, 08 Oct 2024 20:55:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1728446101; x=1729050901; darn=lists.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=whKuisxy/HTfPxo/ibati3/46uwvoqROkgYEC22TIng=; b=ZPPtoKUCNz73UUb71WA1NaNh6t5Z0aXYaUZ44qxPX5wnOlWDByauyX5NdqBTysHEIo ZXP5hQFSItyY69ayl8FeXIk4RImFnwZ0NwCZdj9G4dpmpW+clpOTtqZwmd4Tj6el4J5G J1rloqbEJ2WR5Y59XS+LOsvy8sG9gqSjaY9C6PMpUCrdgpZAS+IYqSOR9hZ9cM66n3od zR19NsX14jQBuK7TKUnbTOf8tx0YB1s1SeLCinOMyZClIvaH+WfLQSPL2m7ji31Nr0m2 +QxCHETTxmkhybfCZAuM0lWpfe8W+T22c/3tU2u4TEJv/391+LmZ2FUvO6Igee4XaaFO xu6w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1728446101; x=1729050901; 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=whKuisxy/HTfPxo/ibati3/46uwvoqROkgYEC22TIng=; b=b5aPE5eKHU5VsF7TLKyuHSsgotN07n7hzP+UwQfxmynzUW33Os8U6Q9GCZbaq0s4tK DBwNtjLbTDgNi67p5olwKgGowJa/R2/iEUg0p2CSai4k2BdAkT8yZODOk2eDvTNzAagh TAB22wJAdse1KSyANyITQcGn+d/ErHoj1eTGf3WgDjI2iKObotsSG2owSZ0UctZvPhfM /Pj9hSrT/Wtq/1+uD4pWqCuU9iZ2XrAXt5USAJ9KqJIGNkyfqX+e92IzxBeruzCvswXT +z2Ln8K8jFc42kBJcN41Ugsrd7cPDdh5vjUetKFn4uMslhkpv+kOf3kOx0C2XklMm4tr gZjw== X-Forwarded-Encrypted: i=1; AJvYcCVEeDzaF5amzQil/cGwyIsSMGEIUnwq1FmUkv5H0UV8EQt34H8Bgnk47rqtHKG+Lu4E4wr3gCKnIRHK/dU3@lists.postgresql.org X-Gm-Message-State: AOJu0Yzr3e1fcz743RNLMPzgSCCLw5HfVglIbz5fFcSESxXJKf1lw5MJ TeH/VyNtE1ddHQJdgTUWP1r41uFLTQTXGBQfxYgb5CEVmATd6xOn X-Google-Smtp-Source: AGHT+IEtHXSD9OlCrGaAHIzFvDuwEs+o4jIfAIvc7ckPq/zytAEY4OfOIk8cwtgHysIZ30haks4JWg== X-Received: by 2002:a17:90a:d906:b0:2e2:9984:802c with SMTP id 98e67ed59e1d1-2e2a2330425mr1438235a91.16.1728446101096; Tue, 08 Oct 2024 20:55:01 -0700 (PDT) Received: from [10.10.20.99] (node-c9q.pool-101-109.dynamic.totinternet.net. [101.109.62.30]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-2e2a57078f1sm452536a91.19.2024.10.08.20.54.56 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 08 Oct 2024 20:55:00 -0700 (PDT) Message-ID: <1921fa8f-b8fe-49f4-8bc1-e0fada75a3af@gmail.com> Date: Wed, 9 Oct 2024 10:54:54 +0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: POC, WIP: OR-clause support for indexes To: Peter Geoghegan Cc: Alexander Korotkov , Tom Lane , Alena Rybakina , jian he , Nikolay Shaplov , pgsql-hackers@lists.postgresql.org, Robert Haas , pgsql-hackers@postgresql.org, Marcos Pegoraro , teodor@sigaev.ru, Peter Eisentraut , Ranier Vilela References: <567ED6CA.2040504@sigaev.ru> <670d1dc2-a280-4cf6-bc29-e2eafb107081@gmail.com> <93464dd6-d484-4021-b71f-e82928bf6758@gmail.com> <63617a30-6078-4e86-b44b-6364e04e210d@postgrespro.ru> <21752e9e-26fb-4665-bfcc-090bf4093e5a@postgrespro.ru> <9ac6480d-6686-4c3a-9149-ba66df4f88ad@gmail.com> <1d5131fc-cd6c-4f61-8ba0-e61c518b168d@gmail.com> Content-Language: en-AU From: Andrei Lepikhov In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 10/4/24 22:00, Peter Geoghegan wrote: > I don't think that removing duplicated constants is all that > important, since we already do that during execution proper. The > nbtree code does this in _bt_preprocess_array_keys. It even does > things like merge together a pair of duplicate SAOPs against the same > column. It doesn't matter if the arrays are of different types, > either.Hmm, my intention is a bit different - removing duplicates allows us to estimate selectivity more precisely, right? Maybe it is not enough to be a core feature, but I continue to think about auto-generated queries and extensions that can help generate proper plans for queries from AI, ORM, etc. users. -- regards, Andrei Lepikhov