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 1rkiVF-00EoNd-BW for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2024 10:40:01 +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 1rkiVD-00Gd0e-IR for pgsql-hackers@arkaria.postgresql.org; Thu, 14 Mar 2024 10:40:00 +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 1rkiVD-00Gd0W-7G for pgsql-hackers@lists.postgresql.org; Thu, 14 Mar 2024 10:39:59 +0000 Received: from mail-yb1-xb32.google.com ([2607:f8b0:4864:20::b32]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rkiVB-004Sfc-4P for pgsql-hackers@postgresql.org; Thu, 14 Mar 2024 10:39:59 +0000 Received: by mail-yb1-xb32.google.com with SMTP id 3f1490d57ef6-dc6dcd9124bso729700276.1 for ; Thu, 14 Mar 2024 03:39:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1710412796; x=1711017596; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=VWroyWYUUnbqVC57pUVCX9oWTqQrLhn971A9w9PywUk=; b=iAC/bs8oR3nmM19TKhTEjOye59H2Yq85Z2cmlQRVGUBwQOeDWK3Ueix4MaJQ4fPJpJ nzrhdrsbV9NlPWnQPhhyjfBbSwtGJYzJSiGZwe3VInRXia9BugA/D6+gw4bXscbkbuV3 cII65N7xFkE8dDdqKpDkB6AAJH1p7qYYtfwxDdtvDmYCpL8t1Sxu/qtxZU/0/4SAyXEC eNsgH20surueR0moR0Lb/HXMwKtQLwF13ky6JAZE8Yg2J7BNbpgd6US88HLor9+UTHGy QXb08W8UkuTFUi7g2S24Ky+7PsXjRXy8SEwwBig3Yfm+uc1N8B6ykIToqmK8Ufl+ZAb8 MYKg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710412796; x=1711017596; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=VWroyWYUUnbqVC57pUVCX9oWTqQrLhn971A9w9PywUk=; b=PcsTTYt6WLJqqutiCHy9glvluoITIFdCUbaNKcvyktmlDIJraSrCUVRNnDMpr2OELv if/jg3kRvvk3RKSl9ix+khQ7yC4kzZy4K7MZy/FdS1KG/GPVc7USsCFE21qEhdEn6z4p JAs37h5tj9I6Wj7HBbLH1B2ctOiB26LmfVFONYeNSBXih4euo3iwHgm3FL6cKbeInaTI iBwpewXMrk6gafRDfHsmXaMuky8OZgfF4sk8BuNwn3UFCc4WyqxmVhenCChGWhMYGivu k0RWp8A9jefKO0ATLm80I9Z3d0WTQvoemycqMMMg/oBuBAJWvvADXfN98iZyR9cvxW3l Oe6g== X-Forwarded-Encrypted: i=1; AJvYcCVKoXfYQtm0ZB1MoV3T8KLdYa+ji/EtOnqMrmf8/5Iat2ReO7EI4wZmqSGRzy/isORxeRyTRZTUgYqoFjo5O0RnrsmVAoTBE6AVsqTs X-Gm-Message-State: AOJu0YwSMI+poK/jRAemrf+9E64Wa46d84oc0UzaLWedIWIZcwtqbwPZ Y7V4iF9q3wv+2M6tnkFwUJwB/ZGAJ+kQxln6ya7VmMcXEAqN2pazicxc5Pg3gdYbVSwTDOHH7u6 h8Da4SWka5LNZrd45IAqpyPQKFdw= X-Google-Smtp-Source: AGHT+IEfo1FUxCKdP5MuYNIMoGcWbmNeKsxuIUcyHYdDvp/VE8+ZyEelS5P6My8Ts2ain2Gy9+UpP68zwRGXlBWfL8I= X-Received: by 2002:a05:6902:1026:b0:dcd:4878:1f9 with SMTP id x6-20020a056902102600b00dcd487801f9mr1351029ybt.8.1710412795575; Thu, 14 Mar 2024 03:39:55 -0700 (PDT) MIME-Version: 1.0 References: <567ED6CA.2040504@sigaev.ru> <54009ba5-4aea-4344-a30d-e3558a59e2a9@postgrespro.ru> <380e5683-cdfd-4220-ab9b-7cccb9d3e480@postgrespro.ru> <7389d0dd-05d5-41b7-a12d-2e73f939f851@postgrespro.ru> <74e3c8bc-dccd-45e5-ad2d-6a6e96fc5864@postgrespro.ru> <67bd918d-285e-44d2-a207-f52d9a4c35e6@postgrespro.ru> In-Reply-To: <67bd918d-285e-44d2-a207-f52d9a4c35e6@postgrespro.ru> From: Alexander Korotkov Date: Thu, 14 Mar 2024 12:39:42 +0200 Message-ID: Subject: Re: POC, WIP: OR-clause support for indexes To: Andrei Lepikhov Cc: jian he , Alena Rybakina , Robert Haas , pgsql-hackers@postgresql.org, Peter Geoghegan , "Finnerty, Jim" , Marcos Pegoraro , teodor@sigaev.ru, Tomas Vondra , Peter Eisentraut , Ranier Vilela Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Mar 14, 2024 at 12:11=E2=80=AFPM Andrei Lepikhov wrote: > > On 14/3/2024 16:31, Alexander Korotkov wrote: > > On Wed, Mar 13, 2024 at 2:16=E2=80=AFPM Andrei Lepikhov > > > wrote: > > > On 13/3/2024 18:05, Alexander Korotkov wrote: > > > > On Wed, Mar 13, 2024 at 7:52=E2=80=AFAM Andrei Lepikhov > > > > Given all of the above, I think moving transformation to the > > > > canonicalize_qual() would be the right way to go. > > > Ok, I will try to move the code. > > > I have no idea about the timings so far. I recall the last time I go= t > > > bogged down in tons of duplicated code. I hope with an almost-ready > > > sketch, it will be easier. > > > > Thank you! I'll be looking forward to the updated patch. > Okay, I moved the 0001-* patch to the prepqual.c module. See it in the > attachment. I treat it as a transient patch. > It has positive outcomes as well as negative ones. > The most damaging result you can see in the partition_prune test: > partition pruning, in some cases, moved to the executor initialization > stage. I guess, we should avoid it somehow in the next version. Thank you, Andrei. Looks like a very undesirable side effect. Do you have any idea why it happens? Partition pruning should work correctly for both transformed and non-transformed quals, why does transformation hurt it? ------ Regards, Alexander Korotkov