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 1rQ3TF-00G9i2-OO for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2024 10:48:34 +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 1rQ3TE-00Cdbe-J7 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Jan 2024 10:48:32 +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 1rQ3TE-00CdbV-8S for pgsql-hackers@lists.postgresql.org; Wed, 17 Jan 2024 10:48:32 +0000 Received: from mail-yb1-xb31.google.com ([2607:f8b0:4864:20::b31]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rQ3TB-002HH7-0E for pgsql-hackers@lists.postgresql.org; Wed, 17 Jan 2024 10:48:31 +0000 Received: by mail-yb1-xb31.google.com with SMTP id 3f1490d57ef6-db4364ecd6aso7463562276.2 for ; Wed, 17 Jan 2024 02:48:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1705488507; x=1706093307; 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=yWSdz2NO6btu7LI6pPqjMQG9/wCySM2eMwVL9SxTvpc=; b=PADcHcM+6sutu/bTeLS5jouSp28CPgzZ60YKXXeBKeJ8L0XMsNbfsxKyCDSRf1YUsX OL5C2EF3CKrZhD/ppQdaaoXTy6zLCGJMcAEuHTqULXNp1pYHJrgTkhltmYWTaBqmtZYa LKY03sIkXC2ffA2sAWY0P+3hmmCdnNKvxOcZjyeMJM6y/9sopeYYCA6MSjPB2MPf1jrt qmM3oUv/n3MHH3BYdNlOpc5YYcOBhiSyy5CJWr73XVjvLbJnM9zIZ0Uf7iPTZTaOaIMz GX8Esyc5ALJZHcK/0XA7LtEcwCijfptsXGjhnrS8YdrA/2szXKsRFP5a0wyWvdtHH1Xx 0KJQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1705488507; x=1706093307; 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=yWSdz2NO6btu7LI6pPqjMQG9/wCySM2eMwVL9SxTvpc=; b=SnHVqF2K0yUKVjqi582g685d5FypiBiTi6sVpYxfS1jA6Z3yVmSQ4nfvXES99Ya2FB 2AOoamwNVTLaVn+D2tuOYMi3R77y7jICGaK0ufaYn0gzT1xxnZy7BosKcZH72DKEmf4Y z5ET8G8NLK3JlWY0DIgFk7dWunNxYztFO3FB5c5ZRc3ugp537XT+bQa1lVG+tLnpv6QF EEEJTDREW5Sygy3wUyXCUIa3fV/YNC9clX7o3GSJ7UEf6zvvj9IspJOmEV3Dmbau+x7c EQqAaXbYf/nzG7oowY9PQRnvufu1lAb6g61DXuyICFoTsgml9OqV7brfxHjnCpnUYTGM PABQ== X-Gm-Message-State: AOJu0YxUgo0J5Cg9ym9UPI44pi0ZAVq3vC9oU3Qai8uFP3Wz+r0RIhAB i2XKQVD6NbM9PqgzymE3HQ2Q2Qg1VoTvCA57u7A= X-Google-Smtp-Source: AGHT+IHIXGEvidHkIYIdQxELa/f2ilbzrEAgRUBaomkYWkumj6aJ+rtfu05g69e27XFi8Js8bH7F4UhF9xWK04nAyqU= X-Received: by 2002:a25:fc0d:0:b0:dc2:1e1a:cbec with SMTP id v13-20020a25fc0d000000b00dc21e1acbecmr1886113ybd.103.1705488506601; Wed, 17 Jan 2024 02:48:26 -0800 (PST) MIME-Version: 1.0 References: <8afecd87-d1e5-241c-5e3e-75e1c62c279b@enterprisedb.com> <1bc5e1e4-380b-213d-6e6a-d5e8f7f0c7f5@enterprisedb.com> <84ffb566-8038-ab35-c841-7a5e5728a247@enterprisedb.com> <525ea957-88ff-e2c6-2975-474c849aa234@ulb.be> <48a78946-f380-a279-e75f-711846e509f8@ulb.be> <4c443cf6-96af-0953-fd5b-bd2b5c0c6f00@ulb.be> <2516071.1699991181@sss.pgh.pa.us> <08b2dea8-6dca-06e4-a53d-3e6334e7645b@ulb.be> In-Reply-To: <08b2dea8-6dca-06e4-a53d-3e6334e7645b@ulb.be> From: vignesh C Date: Wed, 17 Jan 2024 16:18:15 +0530 Message-ID: Subject: Re: Implement missing join selectivity estimation for range types To: Schoemans Maxime Cc: Tom Lane , Damir Belyalov , PostgreSQL Hackers , SAKR Mahmoud , Diogo Repas , LUO Zhicheng , Tomas Vondra , Andrey Lepikhov Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, 5 Jan 2024 at 23:09, Schoemans Maxime wrote: > > On 05/01/2024 11:37, vignesh C wrote: > > One of the tests was aborted at [1], kindly post an updated patch for > the same: > > Thank you for notifying us. > I believe I fixed the issue but it is hard to be certain as the issue > did not arise when running the regression tests locally. I'm noticing this issue is not yet resolved, the CFBot is still failing at [1] with: #7 0x000055cddc25cd93 in range_cmp_bound_values (typcache=typcache@entry=0x629000030b60, b1=b1@entry=0x61c000016f08, b2=b2@entry=0x61c0000180b8) at rangetypes.c:2090 [19:55:02.591] No locals. [19:55:02.591] #8 0x000055cddc2685c1 in calc_hist_join_selectivity (typcache=typcache@entry=0x629000030b60, hist1=hist1@entry=0x61c0000180b8, nhist1=nhist1@entry=101, hist2=hist2@entry=0x61c0000168b8, nhist2=nhist2@entry=101) at rangetypes_selfuncs.c:1295 [19:55:02.591] i = 0 [19:55:02.591] j = 101 [19:55:02.591] selectivity = 0 [19:55:02.591] prev_sel1 = -1 [19:55:02.591] prev_sel2 = 0 [19:55:02.591] #9 0x000055cddc269aaa in rangejoinsel (fcinfo=) at rangetypes_selfuncs.c:1479 [19:55:02.591] root = [19:55:02.591] operator = [19:55:02.591] args = [19:55:02.591] sjinfo = [19:55:02.591] vardata1 = {var = , rel = , statsTuple = , freefunc = , vartype = , atttype = , atttypmod = , isunique = , acl_ok = } [19:55:02.591] vardata2 = {var = , rel = , statsTuple = , freefunc = , vartype = , atttype = , atttypmod = , isunique = , acl_ok = } [19:55:02.591] hist1 = {staop = , stacoll = , valuetype = , values = , nvalues = , numbers = , nnumbers = , values_arr = , numbers_arr = } [19:55:02.591] hist2 = {staop = , stacoll = , valuetype = , values = , nvalues = , numbers = , nnumbers = , values_arr = , numbers_arr = } [19:55:02.591] sslot = {staop = , stacoll = , valuetype = , values = , nvalues = , numbers = , nnumbers = , values_arr = , numbers_arr = } [19:55:02.591] reversed = [19:55:02.591] selec = 0.001709375000000013 [19:55:02.591] typcache = 0x629000030b60 [19:55:02.591] stats1 = [19:55:02.591] stats2 = [19:55:02.591] empty_frac1 = 0 [19:55:02.591] empty_frac2 = 0 [19:55:02.591] null_frac1 = 0 [19:55:02.591] null_frac2 = 0 [19:55:02.591] nhist1 = 101 [19:55:02.591] nhist2 = 101 [19:55:02.591] hist1_lower = 0x61c0000168b8 [19:55:02.591] hist1_upper = 0x61c0000170b8 [19:55:02.591] hist2_lower = 0x61c0000178b8 [19:55:02.591] hist2_upper = 0x61c0000180b8 [19:55:02.591] empty = [19:55:02.591] i = [19:55:02.591] __func__ = "rangejoinsel" [19:55:02.591] #10 0x000055cddc3b761f in FunctionCall5Coll (flinfo=flinfo@entry=0x7ffc1628d710, collation=collation@entry=0, arg1=arg1@entry=107545982648856, arg2=arg2@entry=3888, arg3=arg3@entry=107820862916056, arg4=arg4@entry=0, arg5=) at fmgr.c:1242 [19:55:02.591] fcinfodata = {fcinfo = {flinfo = , context = , resultinfo = , fncollation = , isnull = , nargs = , args = 0x0}, fcinfo_data = { }} [19:55:02.591] fcinfo = 0x7ffc1628d5e0 [19:55:02.591] result = [19:55:02.591] __func__ = "FunctionCall5Coll" [19:55:02.591] #11 0x000055cddc3b92ee in OidFunctionCall5Coll (functionId=8355, collation=collation@entry=0, arg1=arg1@entry=107545982648856, arg2=arg2@entry=3888, arg3=arg3@entry=107820862916056, arg4=arg4@entry=0, arg5=) at fmgr.c:1460 [19:55:02.591] flinfo = {fn_addr = , fn_oid = , fn_nargs = , fn_strict = , fn_retset = , fn_stats = , fn_extra = , fn_mcxt = , fn_expr = } [19:55:02.591] #12 0x000055cddbe834ae in join_selectivity (root=root@entry=0x61d00017c218, operatorid=operatorid@entry=3888, args=0x6210003bc5d8, inputcollid=0, jointype=jointype@entry=JOIN_INNER, sjinfo=sjinfo@entry=0x7ffc1628db30) at ../../../../src/include/postgres.h:324 [19:55:02.591] oprjoin = [19:55:02.591] result = [19:55:02.591] __func__ = "join_selectivity" [19:55:02.591] #13 0x000055cddbd8c18c in clause_selectivity_ext (root=root@entry=0x61d00017c218, clause=0x6210003bc678, varRelid=varRelid@entry=0, jointype=jointype@entry=JOIN_INNER, sjinfo=sjinfo@entry=0x7ffc1628db30, use_extended_stats=use_extended_stats@entry=true) at clausesel.c:841 I have changed the status to "Waiting on Author", feel free to post an updated version, check CFBot and update the Commitfest entry accordingly. [1] - https://cirrus-ci.com/task/5698117824151552 Regards, Vignesh