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 1sityt-00AnU6-KM for pgsql-general@arkaria.postgresql.org; Tue, 27 Aug 2024 11:03: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 1sityq-005yRB-UH for pgsql-general@arkaria.postgresql.org; Tue, 27 Aug 2024 11:03:21 +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 1sityq-005yR3-HJ for pgsql-general@lists.postgresql.org; Tue, 27 Aug 2024 11:03:21 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1sityk-001fux-TX for pgsql-general@lists.postgresql.org; Tue, 27 Aug 2024 11:03:19 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-5334a8a1b07so6580589e87.1 for ; Tue, 27 Aug 2024 04:03:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1724756593; x=1725361393; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=yq5Dn41Nll3tXu4oJODUMt0MRDM6bxYnG3konEkpOg8=; b=X6S1ZUJlhGUqIPYfuQy5DU4mlbq4P7hJQPdiaLKjyVxDlyrC/0qI3Qrf174E6xBvUr akoGu9XbsqT2L73ctN8cH1w+0zQ2sk0nPT5XDdtDDAcuvpoAEQ97SQNJ5FbW3VA3zNSl tRd8/eaDe+d/SZ2z7z7cmpKBmv8Jd2xb2ceG+lR30tT3NaaGIKfPYiacQTW7IH5vqIND 2fHl8QYU0Qyglyu6xZ5UMqEYtv4/fiSmOcrBFbB6RmYkR/3QneQaQyQseXL9XGRcwiVe jjnjtryucrprN0o4tDyRiWJM/POfuAzY04kVb3IZ5DlZMZjQtUknWQkrjftF8JXMlNWM dUnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1724756593; x=1725361393; h=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=yq5Dn41Nll3tXu4oJODUMt0MRDM6bxYnG3konEkpOg8=; b=Yg4vgZDgaPoZq2CAzETEaYSgD7DXsqITtU8SzCJYi65mYRadT/gp9ePl210ov7obbL NYnG/BryLdSbpntjqOfHenxBsO+tzbknPVjcTh4XGG/l/6mOxWbKatmV2LmPAZY81s0o d+Ni4GEw/hGfr4/tAH4EQ4mGI7baPsucUa0Y3EhmeBtBoT9VIFsSeUKYjGxq8MvQbCXv pXROj9V3zHKXRc6d9Si5kmc/VLWpRB1/W1pEDuaPpVQT05MSbVjDtaIT7VIYTDb7Hwab XtgvBFod9luO+Dbw6X/TUqOeYptqlYtEOhC7hBzDtknXJBoAlxiaSvRyLmXgwl7SHMGr R2BA== X-Forwarded-Encrypted: i=1; AJvYcCX/Swx7cGtJCPVRXGM7A13ut/N9asQLE4usXz3o8Q5RlOwuYjoz5ebNSxFDrej2LvPwJ2FF0KGURxzs1OJH@lists.postgresql.org X-Gm-Message-State: AOJu0Ywi5iuHS6qSYGoT4tN3co7arg+tU0PwuPxpY78e7GSzx0wpuUK4 Zv96v+cJRWDY2khNPlFUqFHCXgtLExV2XnUdpGGsLZ00rzy6UsN6dx7mw3EaXNm6oUeC7z6bHuK 6i5tJuY0urlRGnPg4Vj7S/zhCMDw= X-Google-Smtp-Source: AGHT+IETlqDM4H9nbUeiGClSXVAMTFmvM7wl2SyrYZALgc104ek2P80kT5GF148o81htgANXE4+utkW8wFF2VyN1zwk= X-Received: by 2002:a05:6512:e97:b0:52c:daa4:2f5c with SMTP id 2adb3069b0e04-53438861100mr8575955e87.42.1724756592637; Tue, 27 Aug 2024 04:03:12 -0700 (PDT) MIME-Version: 1.0 References: <2962669.1724722813@sss.pgh.pa.us> <2965760.1724724227@sss.pgh.pa.us> In-Reply-To: <2965760.1724724227@sss.pgh.pa.us> From: David Rowley Date: Tue, 27 Aug 2024 23:03:00 +1200 Message-ID: Subject: Re: Significant Execution Time Difference Between PG13.14 and PG16.4 for Query on information_schema Tables. To: Tom Lane Cc: nikhil raj , "pgsql-generallists.postgresql.org" , NIKITA PATEL , Patel Khushbu Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, 27 Aug 2024 at 14:03, Tom Lane wrote: > Yeah, I got that same result by bisecting. It seems like it's > somehow related to the cast to information_schema.sql_identifier: > we are able to get rid of that normally but seem to fail to do so > in this query. In case it saves you a bit of time, I stripped as much of the unrelated stuff out as I could and got: create table t (a name, b int); explain select * from (select a::varchar,b from (select distinct a,b from t) st) t right join t t2 on t.b=t2.b where t.a='test'; getting rid of the cast or swapping to INNER JOIN rather than RIGHT JOIN means that qual_is_pushdown_safe() gets a Var rather than a PlaceHolderVar. David