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 1tBrw8-006d7a-0G for pgsql-general@arkaria.postgresql.org; Fri, 15 Nov 2024 08:44:15 +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 1tBrw5-008S8o-7e for pgsql-general@arkaria.postgresql.org; Fri, 15 Nov 2024 08:44:13 +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 1tBrw4-008S8g-SA for pgsql-general@lists.postgresql.org; Fri, 15 Nov 2024 08:44:13 +0000 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tBrw2-0022fh-9X for pgsql-general@lists.postgresql.org; Fri, 15 Nov 2024 08:44:12 +0000 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43163667f0eso12557405e9.0 for ; Fri, 15 Nov 2024 00:44:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=cybertec.at; t=1731660249; x=1732265049; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:from:to:cc:subject:date :message-id:reply-to; bh=nrXobxN86Y5w5H3T4/X4nkldgIu6T8GeZAsDybPtLgU=; b=mS3EIzifgI/akZYuK+FqGO0z8+WiBmu8z4h+BlySqAjZw8DUUrv3NVuwt4vS4eSTyu CAgW1o60fI7x4qJwWr3T5H46FVq4KJjiBBPj6JJKgHHRD+Humc6gPBf+ghmzPSng4YQU WnTHy1cU99kt7nnaH3imaEeXmc9c/sAMTu4Ag= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731660249; x=1732265049; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:to:from:subject:message-id:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=nrXobxN86Y5w5H3T4/X4nkldgIu6T8GeZAsDybPtLgU=; b=plYuVwEs9hKJs3sbUlFPzKXW1Q+3+uYlJcaF4gvs8RnN7MwTArMWgkPHVNJkJqmt2j wytBD3BTYTrSERqm/C+6hSIjcnxX4APyNrWAO48B6/fQYpRbk9FyAlq3BEtMDaSA3jJy ltuIALCol7BfOGeFE58j0T7bUYZN2CPOrAsGD3i2VnPUge+cMiAYCyXSWCUfSX5LvyPZ 5VAIziJzj3fww7cbCeYpKtik7x271Kw/uF+Fcoa4/OzSg11xgOxlEJQOZrR2axdcpwf9 DeSjDRpKVgpFWiWGhKr36fdHZUmkQzpAhrm6u0+dhUYOQ4Fz99ZJP1sHSFe+vo85Fakw B7iA== X-Forwarded-Encrypted: i=1; AJvYcCW+P6DhTdNlGhXGvOUBge1XCDp8QaQdwV/wFtbxEDgAPUXQQZCJBBn90w1VBxst10cgqI4CfXrfg2mttY1J@lists.postgresql.org X-Gm-Message-State: AOJu0YzL69Ik6ODR1umxLPorJibTmXB1feLM9tk15k1Ng4yqX41V2IDW V19GEvGQ/zNhzil3YydkMLjqbCIXzuSp+5P9hqRB2E8TzpYF6khhbZksy7pUjtI= X-Google-Smtp-Source: AGHT+IGqKFMF6/RTkOf/9fAWGSba9052DN+XQqUzRQMmPiMHLpbyJNzAyfiPTKZMv99PJK1SMRS52g== X-Received: by 2002:a05:600c:5021:b0:42c:bf94:f9a6 with SMTP id 5b1f17b1804b1-432df77a991mr12057695e9.26.1731660249290; Fri, 15 Nov 2024 00:44:09 -0800 (PST) Received: from localhost.localdomain ([2001:871:260:81b2:f6dd:a357:3cb8:2b03]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-432daafc6b3sm48401685e9.0.2024.11.15.00.44.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Nov 2024 00:44:09 -0800 (PST) Message-ID: <18994f31b8e5f9d7a0f0327f99fcb73e647ed99d.camel@cybertec.at> Subject: Re: Validating check constraints without a table scan? From: Laurenz Albe To: Philip Couling , pgsql-general@lists.postgresql.org Date: Fri, 15 Nov 2024 09:44:08 +0100 In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.52.4 (3.52.4-2.fc40) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, 2024-11-14 at 21:33 +0000, Philip Couling wrote: > Is there a solid ready why validating check constraints cannot use existi= ng indexes? > If I can prove the constraint is valid so trivially with a SELECT, then w= hy can > Postgres not do the same (or similar)? I assume that the simple answer is: because nobody implemented that. Yours, Laurenz Albe