You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{"payload":{"commit":{"oid":"0d3b231eebf41170f15605a943eb58e8d3d18374","url":"/postgres/postgres/commit/0d3b231eebf41170f15605a943eb58e8d3d18374","authoredDate":"2011-09-01T00:18:28.000-04:00","committedDate":"2011-09-01T00:19:38.000-04:00","shortMessage":null,"shortMessageMarkdown":"\u003cdiv\u003eFurther repair of eqjoinsel ndistinct-clamping logic.\u003c/div\u003e","shortMessageMarkdownLink":null,"bodyMessageHtml":"Examination of examples provided by Mark Kirkwood and others has convinced\nme that actually commit \u003ca class=\"commit-link\" data-hovercard-type=\"commit\" data-hovercard-url=\"https://github.com/postgres/postgres/commit/7f3eba30c9d622d1981b1368f2d79ba0999cdff2/hovercard\" href=\"https://github.com/postgres/postgres/commit/7f3eba30c9d622d1981b1368f2d79ba0999cdff2\"\u003e\u003ctt\u003e7f3eba3\u003c/tt\u003e\u003c/a\u003e was quite\na few bricks shy of a load. The useful part of that patch was clamping\nndistinct for the inner side of a semi or anti join, and the reason why\nthat's needed is that it's the only way that restriction clauses\neliminating rows from the inner relation can affect the estimated size of\nthe join result. I had not clearly understood why the clamping was\nappropriate, and so mis-extrapolated to conclude that we should clamp\nndistinct for the outer side too, as well as for both sides of regular\njoins. These latter actions were all wrong, and are reverted with this\npatch. In addition, the clamping logic is now made to affect the behavior\nof both paths in eqjoinsel_semi, with or without MCV lists to compare.\nWhen we have MCVs, we suppose that the most common values are the ones\nthat are most likely to survive the decimation resulting from a lower\nrestriction clause, so we think of the clamping as eliminating non-MCV\nvalues, or potentially even the least-common MCVs for the inner relation.\n\nBack-patch to 8.4, same as previous fixes in this area.","authors":[{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false}],"committerAttribution":false,"committer":{"login":"tglsfdc","displayName":"Tom Lane","avatarUrl":"https://avatars.githubusercontent.com/u/8755309?v=4","path":"/tglsfdc","isGitHub":false},"parents":["7971a57fd4ca4253393b77700d59670b5c6ec252"],"globalRelayId":"MDY6Q29tbWl0OTI3NDQyOjBkM2IyMzFlZWJmNDExNzBmMTU2MDVhOTQzZWI1OGU4ZDNkMTgzNzQ=","sha1":"7971a57fd4ca4253393b77700d59670b5c6ec252","sha2":"0d3b231eebf41170f15605a943eb58e8d3d18374"},"currentUser":null,"repo":{"id":927442,"defaultBranch":"master","name":"postgres","ownerLogin":"postgres","currentUserCanPush":false,"isFork":false,"isEmpty":false,"createdAt":"2010-09-21T11:35:45.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/177543?v=4","public":true,"private":false,"isOrgOwned":true},"diffEntryData":[{"diffLines":[{"stylingDirective":null,"type":"HUNK","blobLineNumber":141,"text":"@@ -142,11 +142,10 @@ static double ineq_histogram_selectivity(PlannerInfo *root,","html":"@@ -142,11 +142,10 @@ static double ineq_histogram_selectivity(PlannerInfo *root,","displayNoNewLineWarning":false,"position":0,"left":141,"right":141},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":142,"text":" \t\t\t\t\t\t FmgrInfo *opproc, bool isgt,","html":" \t\t\t\t\t\t \u003cspan class=pl-smi\u003eFmgrInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003eopproc\u003c/span\u003e, \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-s1\u003eisgt\u003c/span\u003e,","displayNoNewLineWarning":false,"position":1,"left":142,"right":142},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":143,"text":" \t\t\t\t\t\t Datum constval, Oid consttype);","html":" \t\t\t\t\t\t \u003cspan class=pl-smi\u003eDatum\u003c/span\u003e \u003cspan class=pl-s1\u003econstval\u003c/span\u003e, \u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003econsttype\u003c/span\u003e);","displayNoNewLineWarning":false,"position":2,"left":143,"right":143},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":144,"text":" static double eqjoinsel_inner(Oid operator,","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003edouble\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_inner\u003c/span\u003e(\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003eoperator\u003c/span\u003e,","displayNoNewLineWarning":false,"position":3,"left":144,"right":144},{"stylingDirective":null,"type":"DELETION","blobLineNumber":145,"text":"-\t\t\t\tVariableStatData *vardata1, VariableStatData *vardata2,","html":"-\t\t\t\t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":4,"left":145,"right":144},{"stylingDirective":null,"type":"DELETION","blobLineNumber":146,"text":"-\t\t\t\tRelOptInfo *rel1, RelOptInfo *rel2);","html":"-\t\t\t\t\u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel1\u003c/span\u003e, \u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":5,"left":146,"right":144},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":145,"text":"+\t\t\t\tVariableStatData *vardata1, VariableStatData *vardata2);","html":"+\t\t\t\t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":6,"left":146,"right":145},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":146,"text":" static double eqjoinsel_semi(Oid operator,","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003edouble\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_semi\u003c/span\u003e(\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003eoperator\u003c/span\u003e,","displayNoNewLineWarning":false,"position":7,"left":147,"right":146},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":147,"text":" \t\t\t VariableStatData *vardata1, VariableStatData *vardata2,","html":" \t\t\t \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":8,"left":148,"right":147},{"stylingDirective":null,"type":"DELETION","blobLineNumber":149,"text":"-\t\t\t RelOptInfo *rel1, RelOptInfo *rel2);","html":"-\t\t\t \u003cspan class=\"pl-smi\"\u003eRelOptInfo\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-first\"\u003erel1\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-smi x\"\u003eRelOptInfo\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-last\"\u003erel2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":9,"left":149,"right":147},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":148,"text":"+\t\t\t RelOptInfo *inner_rel);","html":"+\t\t\t \u003cspan class=\"pl-smi\"\u003eRelOptInfo\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-first x-last\"\u003einner_rel\u003c/span\u003e);","displayNoNewLineWarning":false,"position":10,"left":149,"right":148},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":149,"text":" static bool convert_to_scalar(Datum value, Oid valuetypid, double *scaledvalue,","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-en\u003econvert_to_scalar\u003c/span\u003e(\u003cspan class=pl-smi\u003eDatum\u003c/span\u003e \u003cspan class=pl-s1\u003evalue\u003c/span\u003e, \u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003evaluetypid\u003c/span\u003e, \u003cspan class=pl-smi\u003edouble\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003escaledvalue\u003c/span\u003e,","displayNoNewLineWarning":false,"position":11,"left":150,"right":149},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":150,"text":" \t\t\t\t Datum lobound, Datum hibound, Oid boundstypid,","html":" \t\t\t\t \u003cspan class=pl-smi\u003eDatum\u003c/span\u003e \u003cspan class=pl-s1\u003elobound\u003c/span\u003e, \u003cspan class=pl-smi\u003eDatum\u003c/span\u003e \u003cspan class=pl-s1\u003ehibound\u003c/span\u003e, \u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003eboundstypid\u003c/span\u003e,","displayNoNewLineWarning":false,"position":12,"left":151,"right":150},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":151,"text":" \t\t\t\t double *scaledlobound, double *scaledhibound);","html":" \t\t\t\t \u003cspan class=pl-smi\u003edouble\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003escaledlobound\u003c/span\u003e, \u003cspan class=pl-smi\u003edouble\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003escaledhibound\u003c/span\u003e);","displayNoNewLineWarning":false,"position":13,"left":152,"right":151},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2009,"text":"@@ -2011,47 +2010,35 @@ eqjoinsel(PG_FUNCTION_ARGS)","html":"@@ -2011,47 +2010,35 @@ eqjoinsel(PG_FUNCTION_ARGS)","displayNoNewLineWarning":false,"position":14,"left":2010,"right":2009},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2010,"text":" \tVariableStatData vardata1;","html":" \t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-s1\u003evardata1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":15,"left":2011,"right":2010},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2011,"text":" \tVariableStatData vardata2;","html":" \t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-s1\u003evardata2\u003c/span\u003e;","displayNoNewLineWarning":false,"position":16,"left":2012,"right":2011},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2012,"text":" \tbool\t\tjoin_is_reversed;","html":" \t\u003cspan class=pl-smi\u003ebool\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003ejoin_is_reversed\u003c/span\u003e;","displayNoNewLineWarning":false,"position":17,"left":2013,"right":2012},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2014,"text":"-\tRelOptInfo *rel1;","html":"-\t\u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":18,"left":2014,"right":2012},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2015,"text":"-\tRelOptInfo *rel2;","html":"-\t\u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel2\u003c/span\u003e;","displayNoNewLineWarning":false,"position":19,"left":2015,"right":2012},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2013,"text":"+\tRelOptInfo *inner_rel;","html":"+\t\u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003einner_rel\u003c/span\u003e;","displayNoNewLineWarning":false,"position":20,"left":2015,"right":2013},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2014,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":21,"left":2016,"right":2014},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2015,"text":" \tget_join_variables(root, args, sjinfo,","html":" \t\u003cspan class=pl-en\u003eget_join_variables\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003eargs\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e,","displayNoNewLineWarning":false,"position":22,"left":2017,"right":2015},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2016,"text":" \t\t\t\t\t \u0026vardata1, \u0026vardata2, \u0026join_is_reversed);","html":" \t\t\t\t\t \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003ejoin_is_reversed\u003c/span\u003e);","displayNoNewLineWarning":false,"position":23,"left":2018,"right":2016},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2017,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":24,"left":2019,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2020,"text":"-\t/*","html":"-\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":25,"left":2020,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2021,"text":"-\t * Identify the join's direct input relations. We use the min lefthand","html":"-\u003cspan class=pl-c\u003e\t * Identify the join\u0026#39;s direct input relations. We use the min lefthand\u003c/span\u003e","displayNoNewLineWarning":false,"position":26,"left":2021,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2022,"text":"-\t * and min righthand as the inputs, even though the join might actually","html":"-\u003cspan class=pl-c\u003e\t * and min righthand as the inputs, even though the join might actually\u003c/span\u003e","displayNoNewLineWarning":false,"position":27,"left":2022,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2023,"text":"-\t * get done with larger input relations. The min inputs are guaranteed to","html":"-\u003cspan class=pl-c\u003e\t * get done with larger input relations. The min inputs are guaranteed to\u003c/span\u003e","displayNoNewLineWarning":false,"position":28,"left":2023,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2024,"text":"-\t * have been formed by now, though, and always using them ensures","html":"-\u003cspan class=pl-c\u003e\t * have been formed by now, though, and always using them ensures\u003c/span\u003e","displayNoNewLineWarning":false,"position":29,"left":2024,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2025,"text":"-\t * consistency of estimates.","html":"-\u003cspan class=pl-c\u003e\t * consistency of estimates.\u003c/span\u003e","displayNoNewLineWarning":false,"position":30,"left":2025,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2026,"text":"-\t */","html":"-\u003cspan class=pl-c\u003e\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":31,"left":2026,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2027,"text":"-\tif (!join_is_reversed)","html":"-\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-s1\u003ejoin_is_reversed\u003c/span\u003e)","displayNoNewLineWarning":false,"position":32,"left":2027,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2028,"text":"-\t{","html":"-\t{","displayNoNewLineWarning":false,"position":33,"left":2028,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2029,"text":"-\t\trel1 = find_join_input_rel(root, sjinfo-\u003emin_lefthand);","html":"-\t\t\u003cspan class=pl-s1\u003erel1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003efind_join_input_rel\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003emin_lefthand\u003c/span\u003e);","displayNoNewLineWarning":false,"position":34,"left":2029,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2030,"text":"-\t\trel2 = find_join_input_rel(root, sjinfo-\u003emin_righthand);","html":"-\t\t\u003cspan class=pl-s1\u003erel2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003efind_join_input_rel\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003emin_righthand\u003c/span\u003e);","displayNoNewLineWarning":false,"position":35,"left":2030,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2031,"text":"-\t}","html":"-\t}","displayNoNewLineWarning":false,"position":36,"left":2031,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2032,"text":"-\telse","html":"-\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":37,"left":2032,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2033,"text":"-\t{","html":"-\t{","displayNoNewLineWarning":false,"position":38,"left":2033,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2034,"text":"-\t\trel1 = find_join_input_rel(root, sjinfo-\u003emin_righthand);","html":"-\t\t\u003cspan class=pl-s1\u003erel1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003efind_join_input_rel\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003emin_righthand\u003c/span\u003e);","displayNoNewLineWarning":false,"position":39,"left":2034,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2035,"text":"-\t\trel2 = find_join_input_rel(root, sjinfo-\u003emin_lefthand);","html":"-\t\t\u003cspan class=pl-s1\u003erel2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003efind_join_input_rel\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003emin_lefthand\u003c/span\u003e);","displayNoNewLineWarning":false,"position":40,"left":2035,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2036,"text":"-\t}","html":"-\t}","displayNoNewLineWarning":false,"position":41,"left":2036,"right":2017},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2037,"text":"-","html":"-","displayNoNewLineWarning":false,"position":42,"left":2037,"right":2017},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2018,"text":" \tswitch (sjinfo-\u003ejointype)","html":" \t\u003cspan class=pl-k\u003eswitch\u003c/span\u003e (\u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003ejointype\u003c/span\u003e)","displayNoNewLineWarning":false,"position":43,"left":2038,"right":2018},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2019,"text":" \t{","html":" \t{","displayNoNewLineWarning":false,"position":44,"left":2039,"right":2019},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2020,"text":" \t\tcase JOIN_INNER:","html":" \t\t\u003cspan class=pl-k\u003ecase\u003c/span\u003e \u003cspan class=pl-c1\u003eJOIN_INNER\u003c/span\u003e:","displayNoNewLineWarning":false,"position":45,"left":2040,"right":2020},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2021,"text":" \t\tcase JOIN_LEFT:","html":" \t\t\u003cspan class=pl-k\u003ecase\u003c/span\u003e \u003cspan class=pl-c1\u003eJOIN_LEFT\u003c/span\u003e:","displayNoNewLineWarning":false,"position":46,"left":2041,"right":2021},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2022,"text":" \t\tcase JOIN_FULL:","html":" \t\t\u003cspan class=pl-k\u003ecase\u003c/span\u003e \u003cspan class=pl-c1\u003eJOIN_FULL\u003c/span\u003e:","displayNoNewLineWarning":false,"position":47,"left":2042,"right":2022},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2043,"text":"-\t\t\tselec = eqjoinsel_inner(operator, \u0026vardata1, \u0026vardata2,","html":"-\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_inner\u003c/span\u003e(\u003cspan class=pl-s1\u003eoperator\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":48,"left":2043,"right":2022},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2044,"text":"-\t\t\t\t\t\t\t\t\trel1, rel2);","html":"-\t\t\t\t\t\t\t\t\t\u003cspan class=pl-s1\u003erel1\u003c/span\u003e, \u003cspan class=pl-s1\u003erel2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":49,"left":2044,"right":2022},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2023,"text":"+\t\t\tselec = eqjoinsel_inner(operator, \u0026vardata1, \u0026vardata2);","html":"+\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_inner\u003c/span\u003e(\u003cspan class=pl-s1\u003eoperator\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":50,"left":2044,"right":2023},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2024,"text":" \t\t\tbreak;","html":" \t\t\t\u003cspan class=pl-k\u003ebreak\u003c/span\u003e;","displayNoNewLineWarning":false,"position":51,"left":2045,"right":2024},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2025,"text":" \t\tcase JOIN_SEMI:","html":" \t\t\u003cspan class=pl-k\u003ecase\u003c/span\u003e \u003cspan class=pl-c1\u003eJOIN_SEMI\u003c/span\u003e:","displayNoNewLineWarning":false,"position":52,"left":2046,"right":2025},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2026,"text":" \t\tcase JOIN_ANTI:","html":" \t\t\u003cspan class=pl-k\u003ecase\u003c/span\u003e \u003cspan class=pl-c1\u003eJOIN_ANTI\u003c/span\u003e:","displayNoNewLineWarning":false,"position":53,"left":2047,"right":2026},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2027,"text":"+\t\t\t/*","html":"+\t\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":54,"left":2047,"right":2027},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2028,"text":"+\t\t\t * Look up the join's inner relation. min_righthand is sufficient","html":"+\u003cspan class=pl-c\u003e\t\t\t * Look up the join\u0026#39;s inner relation. min_righthand is sufficient\u003c/span\u003e","displayNoNewLineWarning":false,"position":55,"left":2047,"right":2028},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2029,"text":"+\t\t\t * information because neither SEMI nor ANTI joins permit any","html":"+\u003cspan class=pl-c\u003e\t\t\t * information because neither SEMI nor ANTI joins permit any\u003c/span\u003e","displayNoNewLineWarning":false,"position":56,"left":2047,"right":2029},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2030,"text":"+\t\t\t * reassociation into or out of their RHS, so the righthand will","html":"+\u003cspan class=pl-c\u003e\t\t\t * reassociation into or out of their RHS, so the righthand will\u003c/span\u003e","displayNoNewLineWarning":false,"position":57,"left":2047,"right":2030},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2031,"text":"+\t\t\t * always be exactly that set of rels.","html":"+\u003cspan class=pl-c\u003e\t\t\t * always be exactly that set of rels.\u003c/span\u003e","displayNoNewLineWarning":false,"position":58,"left":2047,"right":2031},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2032,"text":"+\t\t\t */","html":"+\u003cspan class=pl-c\u003e\t\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":59,"left":2047,"right":2032},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2033,"text":"+\t\t\tinner_rel = find_join_input_rel(root, sjinfo-\u003emin_righthand);","html":"+\t\t\t\u003cspan class=pl-s1\u003einner_rel\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003efind_join_input_rel\u003c/span\u003e(\u003cspan class=pl-s1\u003eroot\u003c/span\u003e, \u003cspan class=pl-s1\u003esjinfo\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003emin_righthand\u003c/span\u003e);","displayNoNewLineWarning":false,"position":60,"left":2047,"right":2033},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2034,"text":"+","html":"+","displayNoNewLineWarning":false,"position":61,"left":2047,"right":2034},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2035,"text":" \t\t\tif (!join_is_reversed)","html":" \t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (!\u003cspan class=pl-s1\u003ejoin_is_reversed\u003c/span\u003e)","displayNoNewLineWarning":false,"position":62,"left":2048,"right":2035},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2036,"text":" \t\t\t\tselec = eqjoinsel_semi(operator, \u0026vardata1, \u0026vardata2,","html":" \t\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_semi\u003c/span\u003e(\u003cspan class=pl-s1\u003eoperator\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":63,"left":2049,"right":2036},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2050,"text":"-\t\t\t\t\t\t\t\t\t rel1, rel2);","html":"-\t\t\t\t\t\t\t\t\t \u003cspan class=\"pl-s1 x x-first\"\u003erel1\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-s1 x x-last\"\u003erel2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":64,"left":2050,"right":2036},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2037,"text":"+\t\t\t\t\t\t\t\t\t inner_rel);","html":"+\t\t\t\t\t\t\t\t\t \u003cspan class=\"pl-s1 x x-first x-last\"\u003einner_rel\u003c/span\u003e);","displayNoNewLineWarning":false,"position":65,"left":2050,"right":2037},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2038,"text":" \t\t\telse","html":" \t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":66,"left":2051,"right":2038},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2039,"text":" \t\t\t\tselec = eqjoinsel_semi(get_commutator(operator),","html":" \t\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eeqjoinsel_semi\u003c/span\u003e(\u003cspan class=pl-en\u003eget_commutator\u003c/span\u003e(\u003cspan class=pl-s1\u003eoperator\u003c/span\u003e),","displayNoNewLineWarning":false,"position":67,"left":2052,"right":2039},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2040,"text":" \t\t\t\t\t\t\t\t\t \u0026vardata2, \u0026vardata1,","html":" \t\t\t\t\t\t\t\t\t \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e, \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e,","displayNoNewLineWarning":false,"position":68,"left":2053,"right":2040},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2054,"text":"-\t\t\t\t\t\t\t\t\t rel2, rel1);","html":"-\t\t\t\t\t\t\t\t\t \u003cspan class=\"pl-s1 x x-first\"\u003erel2\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-s1 x x-last\"\u003erel1\u003c/span\u003e);","displayNoNewLineWarning":false,"position":69,"left":2054,"right":2040},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2041,"text":"+\t\t\t\t\t\t\t\t\t inner_rel);","html":"+\t\t\t\t\t\t\t\t\t \u003cspan class=\"pl-s1 x x-first x-last\"\u003einner_rel\u003c/span\u003e);","displayNoNewLineWarning":false,"position":70,"left":2054,"right":2041},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2042,"text":" \t\t\tbreak;","html":" \t\t\t\u003cspan class=pl-k\u003ebreak\u003c/span\u003e;","displayNoNewLineWarning":false,"position":71,"left":2055,"right":2042},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2043,"text":" \t\tdefault:","html":" \t\t\u003cspan class=pl-k\u003edefault\u003c/span\u003e:","displayNoNewLineWarning":false,"position":72,"left":2056,"right":2043},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2044,"text":" \t\t\t/* other values not expected here */","html":" \t\t\t\u003cspan class=pl-c\u003e/* other values not expected here */\u003c/span\u003e","displayNoNewLineWarning":false,"position":73,"left":2057,"right":2044},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2063,"text":"@@ -2077,8 +2064,7 @@ eqjoinsel(PG_FUNCTION_ARGS)","html":"@@ -2077,8 +2064,7 @@ eqjoinsel(PG_FUNCTION_ARGS)","displayNoNewLineWarning":false,"position":74,"left":2076,"right":2063},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2064,"text":" */","html":" \u003cspan class=pl-c\u003e */\u003c/span\u003e","displayNoNewLineWarning":false,"position":75,"left":2077,"right":2064},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2065,"text":" static double","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003edouble\u003c/span\u003e","displayNoNewLineWarning":false,"position":76,"left":2078,"right":2065},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2066,"text":" eqjoinsel_inner(Oid operator,","html":" \u003cspan class=pl-en\u003eeqjoinsel_inner\u003c/span\u003e(\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003eoperator\u003c/span\u003e,","displayNoNewLineWarning":false,"position":77,"left":2079,"right":2066},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2080,"text":"-\t\t\t\tVariableStatData *vardata1, VariableStatData *vardata2,","html":"-\t\t\t\t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":78,"left":2080,"right":2066},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2081,"text":"-\t\t\t\tRelOptInfo *rel1, RelOptInfo *rel2)","html":"-\t\t\t\t\u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel1\u003c/span\u003e, \u003cspan class=pl-smi\u003eRelOptInfo\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003erel2\u003c/span\u003e)","displayNoNewLineWarning":false,"position":79,"left":2081,"right":2066},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2067,"text":"+\t\t\t\tVariableStatData *vardata1, VariableStatData *vardata2)","html":"+\t\t\t\t\u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u00
8000
3c/span\u003e)","displayNoNewLineWarning":false,"position":80,"left":2081,"right":2067},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2068,"text":" {","html":" {","displayNoNewLineWarning":false,"position":81,"left":2082,"right":2068},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2069,"text":" \tdouble\t\tselec;","html":" \t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e;","displayNoNewLineWarning":false,"position":82,"left":2083,"right":2069},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2070,"text":" \tdouble\t\tnd1;","html":" \t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":83,"left":2084,"right":2070},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2258,"text":"@@ -2273,26 +2259,10 @@ eqjoinsel_inner(Oid operator,","html":"@@ -2273,26 +2259,10 @@ eqjoinsel_inner(Oid operator,","displayNoNewLineWarning":false,"position":84,"left":2272,"right":2258},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2259,"text":" \t\t * XXX Can we be smarter if we have an MCV list for just one side? It","html":" \u003cspan class=pl-c\u003e\t\t * XXX Can we be smarter if we have an MCV list for just one side? It\u003c/span\u003e","displayNoNewLineWarning":false,"position":85,"left":2273,"right":2259},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2260,"text":" \t\t * seems that if we assume equal distribution for the other side, we","html":" \u003cspan class=pl-c\u003e\t\t * seems that if we assume equal distribution for the other side, we\u003c/span\u003e","displayNoNewLineWarning":false,"position":86,"left":2274,"right":2260},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2261,"text":" \t\t * end up with the same answer anyway.","html":" \u003cspan class=pl-c\u003e\t\t * end up with the same answer anyway.\u003c/span\u003e","displayNoNewLineWarning":false,"position":87,"left":2275,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2276,"text":"-\t\t *","html":"-\u003cspan class=pl-c\u003e\t\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":88,"left":2276,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2277,"text":"-\t\t * An additional hack we use here is to clamp the nd1 and nd2 values","html":"-\u003cspan class=pl-c\u003e\t\t * An additional hack we use here is to clamp the nd1 and nd2 values\u003c/span\u003e","displayNoNewLineWarning":false,"position":89,"left":2277,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2278,"text":"-\t\t * to not more than what we are estimating the input relation sizes to","html":"-\u003cspan class=pl-c\u003e\t\t * to not more than what we are estimating the input relation sizes to\u003c/span\u003e","displayNoNewLineWarning":false,"position":90,"left":2278,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2279,"text":"-\t\t * be, providing a crude correction for the selectivity of restriction","html":"-\u003cspan class=pl-c\u003e\t\t * be, providing a crude correction for the selectivity of restriction\u003c/span\u003e","displayNoNewLineWarning":false,"position":91,"left":2279,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2280,"text":"-\t\t * clauses on those relations.\t(We don't do that in the other path","html":"-\u003cspan class=pl-c\u003e\t\t * clauses on those relations.\t(We don\u0026#39;t do that in the other path\u003c/span\u003e","displayNoNewLineWarning":false,"position":92,"left":2280,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2281,"text":"-\t\t * since there we are comparing the nd values to stats for the whole","html":"-\u003cspan class=pl-c\u003e\t\t * since there we are comparing the nd values to stats for the whole\u003c/span\u003e","displayNoNewLineWarning":false,"position":93,"left":2281,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2282,"text":"-\t\t * relations.) We can apply this clamp both with respect to the base","html":"-\u003cspan class=pl-c\u003e\t\t * relations.) We can apply this clamp both with respect to the base\u003c/span\u003e","displayNoNewLineWarning":false,"position":94,"left":2282,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2283,"text":"-\t\t * relations from which the join variables come, and to the immediate","html":"-\u003cspan class=pl-c\u003e\t\t * relations from which the join variables come, and to the immediate\u003c/span\u003e","displayNoNewLineWarning":false,"position":95,"left":2283,"right":2261},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2284,"text":"-\t\t * input relations of the current join.","html":"-\u003cspan class=pl-c\u003e\t\t * input relations of the current join.\u003c/span\u003e","displayNoNewLineWarning":false,"position":96,"left":2284,"right":2261},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2262,"text":" \t\t */","html":" \u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":97,"left":2285,"right":2262},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2263,"text":" \t\tdouble\t\tnullfrac1 = stats1 ? stats1-\u003estanullfrac : 0.0;","html":" \t\t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003enullfrac1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003estats1\u003c/span\u003e ? \u003cspan class=pl-s1\u003estats1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003estanullfrac\u003c/span\u003e : \u003cspan class=pl-c1\u003e0.0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":98,"left":2286,"right":2263},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2264,"text":" \t\tdouble\t\tnullfrac2 = stats2 ? stats2-\u003estanullfrac : 0.0;","html":" \t\t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003enullfrac2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003estats2\u003c/span\u003e ? \u003cspan class=pl-s1\u003estats2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003estanullfrac\u003c/span\u003e : \u003cspan class=pl-c1\u003e0.0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":99,"left":2287,"right":2264},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2265,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":100,"left":2288,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2289,"text":"-\t\tif (vardata1-\u003erel)","html":"-\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":101,"left":2289,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2290,"text":"-\t\t\tnd1 = Min(nd1, vardata1-\u003erel-\u003erows);","html":"-\t\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end1\u003c/span\u003e, \u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":102,"left":2290,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2291,"text":"-\t\tnd1 = Min(nd1, rel1-\u003erows);","html":"-\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end1\u003c/span\u003e, \u003cspan class=pl-s1\u003erel1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":103,"left":2291,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2292,"text":"-\t\tif (vardata2-\u003erel)","html":"-\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":104,"left":2292,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2293,"text":"-\t\t\tnd2 = Min(nd2, vardata2-\u003erel-\u003erows);","html":"-\t\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":105,"left":2293,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2294,"text":"-\t\tnd2 = Min(nd2, rel2-\u003erows);","html":"-\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003erel2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":106,"left":2294,"right":2265},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2295,"text":"-","html":"-","displayNoNewLineWarning":false,"position":107,"left":2295,"right":2265},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2266,"text":" \t\tselec = (1.0 - nullfrac1) * (1.0 - nullfrac2);","html":" \t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-c1\u003e1.0\u003c/span\u003e \u003cspan class=pl-c1\u003e-\u003c/span\u003e \u003cspan class=pl-s1\u003enullfrac1\u003c/span\u003e) \u003cspan class=pl-c1\u003e*\u003c/span\u003e (\u003cspan class=pl-c1\u003e1.0\u003c/span\u003e \u003cspan class=pl-c1\u003e-\u003c/span\u003e \u003cspan class=pl-s1\u003enullfrac2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":108,"left":2296,"right":2266},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2267,"text":" \t\tif (nd1 \u003e nd2)","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026gt;\u003c/span\u003e \u003cspan class=pl-s1\u003end2\u003c/span\u003e)","displayNoNewLineWarning":false,"position":109,"left":2297,"right":2267},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2268,"text":" \t\t\tselec /= nd1;","html":" \t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e /= \u003cspan class=pl-s1\u003end1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":110,"left":2298,"right":2268},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2288,"text":"@@ -2319,7 +2289,7 @@ eqjoinsel_inner(Oid operator,","html":"@@ -2319,7 +2289,7 @@ eqjoinsel_inner(Oid operator,","displayNoNewLineWarning":false,"position":111,"left":2318,"right":2288},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2289,"text":" static double","html":" \u003cspan class=pl-k\u003estatic\u003c/span\u003e \u003cspan class=pl-smi\u003edouble\u003c/span\u003e","displayNoNewLineWarning":false,"position":112,"left":2319,"right":2289},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2290,"text":" eqjoinsel_semi(Oid operator,","html":" \u003cspan class=pl-en\u003eeqjoinsel_semi\u003c/span\u003e(\u003cspan class=pl-smi\u003eOid\u003c/span\u003e \u003cspan class=pl-s1\u003eoperator\u003c/span\u003e,","displayNoNewLineWarning":false,"position":113,"left":2320,"right":2290},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2291,"text":" \t\t\t VariableStatData *vardata1, VariableStatData *vardata2,","html":" \t\t\t \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e, \u003cspan class=pl-smi\u003eVariableStatData\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e,","displayNoNewLineWarning":false,"position":114,"left":2321,"right":2291},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2322,"text":"-\t\t\t RelOptInfo *rel1, RelOptInfo *rel2)","html":"-\t\t\t \u003cspan class=\"pl-smi\"\u003eRelOptInfo\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-first\"\u003erel1\u003c/span\u003e\u003cspan class=\"x\"\u003e, \u003c/span\u003e\u003cspan class=\"pl-smi x\"\u003eRelOptInfo\u003c/span\u003e\u003cspan class=\"x\"\u003e \u003c/span\u003e\u003cspan class=\"pl-c1 x\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-last\"\u003erel2\u003c/span\u003e)","displayNoNewLineWarning":false,"position":115,"left":2322,"right":2291},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2292,"text":"+\t\t\t RelOptInfo *inner_rel)","html":"+\t\t\t \u003cspan class=\"pl-smi\"\u003eRelOptInfo\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e\u003cspan class=\"pl-s1 x x-first x-last\"\u003einner_rel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":116,"left":2322,"right":2292},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2293,"text":" {","html":" {","displayNoNewLineWarning":false,"position":117,"left":2323,"right":2293},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2294,"text":" \tdouble\t\tselec;","html":" \t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e;","displayNoNewLineWarning":false,"position":118,"left":2324,"right":2294},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2295,"text":" \tdouble\t\tnd1;","html":" \t\u003cspan class=pl-smi\u003edouble\u003c/span\u003e\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":119,"left":2325,"right":2295},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2308,"text":"@@ -2339,6 +2309,25 @@ eqjoinsel_semi(Oid operator,","html":"@@ -2339,6 +2309,25 @@ eqjoinsel_semi(Oid operator,","displayNoNewLineWarning":false,"position":120,"left":2338,"right":2308},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2309,"text":" \tnd1 = get_variable_numdistinct(vardata1);","html":" \t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eget_variable_numdistinct\u003c/span\u003e(\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e);","displayNoNewLineWarning":false,"position":121,"left":2339,"right":2309},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2310,"text":" \tnd2 = get_variable_numdistinct(vardata2);","html":" \t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eget_variable_numdistinct\u003c/span\u003e(\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":122,"left":2340,"right":2310},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2311,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":123,"left":2341,"right":2311},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2312,"text":"+\t/*","html":"+\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":124,"left":2341,"right":2312},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2313,"text":"+\t * We clamp nd2 to be not more than what we estimate the inner relation's","html":"+\u003cspan class=pl-c\u003e\t * We clamp nd2 to be not more than what we estimate the inner relation\u0026#39;s\u003c/span\u003e","displayNoNewLineWarning":false,"position":125,"left":2341,"right":2313},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2314,"text":"+\t * size to be. This is intuitively somewhat reasonable since obviously","html":"+\u003cspan class=pl-c\u003e\t * size to be. This is intuitively somewhat reasonable since obviously\u003c/span\u003e","displayNoNewLineWarning":false,"position":126,"left":2341,"right":2314},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2315,"text":"+\t * there can't be more than that many distinct values coming from the","html":"+\u003cspan class=pl-c\u003e\t * there can\u0026#39;t be more than that many distinct values coming from the\u003c/span\u003e","displayNoNewLineWarning":false,"position":127,"left":2341,"right":2315},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2316,"text":"+\t * inner rel. The reason for the asymmetry (ie, that we don't clamp nd1","html":"+\u003cspan class=pl-c\u003e\t * inner rel. The reason for the asymmetry (ie, that we don\u0026#39;t clamp nd1\u003c/span\u003e","displayNoNewLineWarning":false,"position":128,"left":2341,"right":2316},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2317,"text":"+\t * likewise) is that this is the only pathway by which restriction clauses","html":"+\u003cspan class=pl-c\u003e\t * likewise) is that this is the only pathway by which restriction clauses\u003c/span\u003e","displayNoNewLineWarning":false,"position":129,"left":2341,"right":2317},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2318,"text":"+\t * applied to the inner rel will affect the join result size estimate,","html":"+\u003cspan class=pl-c\u003e\t * applied to the inner rel will affect the join result size estimate,\u003c/span\u003e","displayNoNewLineWarning":false,"position":130,"left":2341,"right":2318},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2319,"text":"+\t * since set_joinrel_size_estimates will multiply SEMI/ANTI selectivity by","html":"+\u003cspan class=pl-c\u003e\t * since set_joinrel_size_estimates will multiply SEMI/ANTI selectivity by\u003c/span\u003e","displayNoNewLineWarning":false,"position":131,"left":2341,"right":2319},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2320,"text":"+\t * only the outer rel's size. If we clamped nd1 we'd be double-counting","html":"+\u003cspan class=pl-c\u003e\t * only the outer rel\u0026#39;s size. If we clamped nd1 we\u0026#39;d be double-counting\u003c/span\u003e","displayNoNewLineWarning":false,"position":132,"left":2341,"right":2320},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2321,"text":"+\t * the selectivity of outer-rel restrictions.","html":"+\u003cspan class=pl-c\u003e\t * the selectivity of outer-rel restrictions.\u003c/span\u003e","displayNoNewLineWarning":false,"position":133,"left":2341,"right":2321},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2322,"text":"+\t *","html":"+\u003cspan class=pl-c\u003e\t *\u003c/span\u003e","displayNoNewLineWarning":false,"position":134,"left":2341,"right":2322},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2323,"text":"+\t * We can apply this clamping both with respect to the base relation from","html":"+\u003cspan class=pl-c\u003e\t * We can apply this clamping both with respect to the base relation from\u003c/span\u003e","displayNoNewLineWarning":false,"position":135,"left":2341,"right":2323},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2324,"text":"+\t * which the join variable comes (if there is just one), and to the","html":"+\u003cspan class=pl-c\u003e\t * which the join variable comes (if there is just one), and to the\u003c/span\u003e","displayNoNewLineWarning":false,"position":136,"left":2341,"right":2324},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2325,"text":"+\t * immediate inner input relation of the current join.","html":"+\u003cspan class=pl-c\u003e\t * immediate inner input relation of the current join.\u003c/span\u003e","displayNoNewLineWarning":false,"position":137,"left":2341,"right":2325},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2326,"text":"+\t */","html":"+\u003cspan class=pl-c\u003e\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":138,"left":2341,"right":2326},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2327,"text":"+\tif (vardata2-\u003erel)","html":"+\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":139,"left":2341,"right":2327},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2328,"text":"+\t\tnd2 = Min(nd2, vardata2-\u003erel-\u003erows);","html":"+\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":140,"left":2341,"right":2328},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2329,"text":"+\tnd2 = Min(nd2, inner_rel-\u003erows);","html":"+\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003einner_rel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":141,"left":2341,"right":2329},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2330,"text":"+","html":"+","displayNoNewLineWarning":false,"position":142,"left":2341,"right":2330},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2331,"text":" \tif (HeapTupleIsValid(vardata1-\u003estatsTuple))","html":" \t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-en\u003eHeapTupleIsValid\u003c/span\u003e(\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003estatsTuple\u003c/span\u003e))","displayNoNewLineWarning":false,"position":143,"left":2342,"right":2331},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2332,"text":" \t{","html":" \t{","displayNoNewLineWarning":false,"position":144,"left":2343,"right":2332},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2333,"text":" \t\tstats1 = (Form_pg_statistic) GETSTRUCT(vardata1-\u003estatsTuple);","html":" \t\t\u003cspan class=pl-s1\u003estats1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-smi\u003eForm_pg_statistic\u003c/span\u003e) \u003cspan class=pl-en\u003eGETSTRUCT\u003c/span\u003e(\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003estatsTuple\u003c/span\u003e);","displayNoNewLineWarning":false,"position":145,"left":2344,"right":2333},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2370,"text":"@@ -2382,11 +2371,21 @@ eqjoinsel_semi(Oid operator,","html":"@@ -2382,11 +2371,21 @@ eqjoinsel_semi(Oid operator,","displayNoNewLineWarning":false,"position":146,"left":2381,"right":2370},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2371,"text":" \t\t\t\t\tuncertainfrac,","html":" \t\t\t\t\t\u003cspan class=pl-s1\u003euncertainfrac\u003c/span\u003e,","displayNoNewLineWarning":false,"position":147,"left":2382,"right":2371},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2372,"text":" \t\t\t\t\tuncertain;","html":" \t\t\t\t\t\u003cspan class=pl-s1\u003euncertain\u003c/span\u003e;","displayNoNewLineWarning":false,"position":148,"left":2383,"right":2372},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2373,"text":" \t\tint\t\t\ti,","html":" \t\t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003ei\u003c/span\u003e,","displayNoNewLineWarning":false,"position":149,"left":2384,"right":2373},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2385,"text":"-\t\t\t\t\tnmatches;","html":"-\t\t\t\t\t\u003cspan class=pl-s1\u003enmatches\u003c/span\u003e;","displayNoNewLineWarning":false,"position":150,"left":2385,"right":2373},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2374,"text":"+\t\t\t\t\tnmatches,","html":"+\t\t\t\t\t\u003cspan class=pl-s1\u003enmatches\u003c/span\u003e,","displayNoNewLineWarning":false,"position":151,"left":2385,"right":2374},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2375,"text":"+\t\t\t\t\tclamped_nvalues2;","html":"+\t\t\t\t\t\u003cspan class=pl-s1\u003eclamped_nvalues2\u003c/span\u003e;","displayNoNewLineWarning":false,"position":152,"left":2385,"right":2375},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2376,"text":"+","html":"+","displayNoNewLineWarning":false,"position":153,"left":2385,"right":2376},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2377,"text":"+\t\t/*","html":"+\t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":154,"left":2385,"right":2377},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2378,"text":"+\t\t * The clamping above could have resulted in nd2 being less than","html":"+\u003cspan class=pl-c\u003e\t\t * The clamping above could have resulted in nd2 being less than\u003c/span\u003e","displayNoNewLineWarning":false,"position":155,"left":2385,"right":2378},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2379,"text":"+\t\t * nvalues2; in which case, we assume that precisely the nd2 most","html":"+\u003cspan class=pl-c\u003e\t\t * nvalues2; in which case, we assume that precisely the nd2 most\u003c/span\u003e","displayNoNewLineWarning":false,"position":156,"left":2385,"right":2379},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2380,"text":"+\t\t * common values in the relation will appear in the join input, and so","html":"+\u003cspan class=pl-c\u003e\t\t * common values in the relation will appear in the join input, and so\u003c/span\u003e","displayNoNewLineWarning":false,"position":157,"left":2385,"right":2380},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2381,"text":"+\t\t * compare to only the first nd2 members of the MCV list. Of course","html":"+\u003cspan class=pl-c\u003e\t\t * compare to only the first nd2 members of the MCV list. Of course\u003c/span\u003e","displayNoNewLineWarning":false,"position":158,"left":2385,"right":2381},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2382,"text":"+\t\t * this is frequently wrong, but it's the best bet we can make.","html":"+\u003cspan class=pl-c\u003e\t\t * this is frequently wrong, but it\u0026#39;s the best bet we can make.\u003c/span\u003e","displayNoNewLineWarning":false,"position":159,"left":2385,"right":2382},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2383,"text":"+\t\t */","html":"+\u003cspan class=pl-c\u003e\t\t */\u003c/span\u003e","displayNoNewLineWarning":false,"position":160,"left":2385,"right":2383},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2384,"text":"+\t\tclamped_nvalues2 = Min(nvalues2, nd2);","html":"+\t\t\u003cspan class=pl-s1\u003eclamped_nvalues2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003envalues2\u003c/span\u003e, \u003cspan class=pl-s1\u003end2\u003c/span\u003e);","displayNoNewLineWarning":false,"position":161,"left":2385,"right":2384},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2385,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":162,"left":2386,"right":2385},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2386,"text":" \t\tfmgr_info(get_opcode(operator), \u0026eqproc);","html":" \t\t\u003cspan class=pl-en\u003efmgr_info\u003c/span\u003e(\u003cspan class=pl-en\u003eget_opcode\u003c/span\u003e(\u003cspan class=pl-s1\u003eoperator\u003c/span\u003e), \u003cspan class=pl-c1\u003e\u0026amp;\u003c/span\u003e\u003cspan class=pl-s1\u003eeqproc\u003c/span\u003e);","displayNoNewLineWarning":false,"position":163,"left":2387,"right":2386},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2387,"text":" \t\thasmatch1 = (bool *) palloc0(nvalues1 * sizeof(bool));","html":" \t\t\u003cspan class=pl-s1\u003ehasmatch1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-smi\u003ebool\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e) \u003cspan class=pl-en\u003epalloc0\u003c/span\u003e(\u003cspan class=pl-s1\u003envalues1\u003c/span\u003e \u003cspan class=pl-c1\u003e*\u003c/span\u003e \u003cspan class=pl-k\u003esizeof\u003c/span\u003e(\u003cspan class=pl-smi\u003ebool\u003c/span\u003e));","displayNoNewLineWarning":false,"position":164,"left":2388,"right":2387},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2389,"text":"-\t\thasmatch2 = (bool *) palloc0(nvalues2 * sizeof(bool));","html":"-\t\t\u003cspan class=\"pl-s1\"\u003ehasmatch2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e (\u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e) \u003cspan class=\"pl-en\"\u003epalloc0\u003c/span\u003e(\u003cspan class=\"pl-s1 x x-first x-last\"\u003envalues2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003esizeof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e));","displayNoNewLineWarning":false,"position":165,"left":2389,"right":2387},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2388,"text":"+\t\thasmatch2 = (bool *) palloc0(clamped_nvalues2 * sizeof(bool));","html":"+\t\t\u003cspan class=\"pl-s1\"\u003ehasmatch2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e (\u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e) \u003cspan class=\"pl-en\"\u003epalloc0\u003c/span\u003e(\u003cspan class=\"pl-s1 x x-first x-last\"\u003eclamped_nvalues2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e*\u003c/span\u003e \u003cspan class=\"pl-k\"\u003esizeof\u003c/span\u003e(\u003cspan class=\"pl-smi\"\u003ebool\u003c/span\u003e));","displayNoNewLineWarning":false,"position":166,"left":2389,"right":2388},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2389,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":167,"left":2390,"right":2389},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2390,"text":" \t\t/*","html":" \t\t\u003cspan class=pl-c\u003e/*\u003c/span\u003e","displayNoNewLineWarning":false,"position":168,"left":2391,"right":2390},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2391,"text":" \t\t * Note we assume that each MCV will match at most one member of the","html":" \u003cspan class=pl-c\u003e\t\t * Note we assume that each MCV will match at most one member of the\u003c/span\u003e","displayNoNewLineWarning":false,"position":169,"left":2392,"right":2391},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2397,"text":"@@ -2399,7 +2398,7 @@ eqjoinsel_semi(Oid operator,","html":"@@ -2399,7 +2398,7 @@ eqjoinsel_semi(Oid operator,","displayNoNewLineWarning":false,"position":170,"left":2398,"right":2397},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2398,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":171,"left":2399,"right":2398},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2399,"text":" \t\t\tint\t\t\tj;","html":" \t\t\t\u003cspan class=pl-smi\u003eint\u003c/span\u003e\t\t\t\u003cspan class=pl-s1\u003ej\u003c/span\u003e;","displayNoNewLineWarning":false,"position":172,"left":2400,"right":2399},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2400,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position"
8000
:173,"left":2401,"right":2400},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2402,"text":"-\t\t\tfor (j = 0; j \u003c nvalues2; j++)","html":"-\t\t\t\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (\u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e; \u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first x-last\"\u003envalues2\u003c/span\u003e; \u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e)","displayNoNewLineWarning":false,"position":174,"left":2402,"right":2400},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2401,"text":"+\t\t\tfor (j = 0; j \u003c clamped_nvalues2; j++)","html":"+\t\t\t\u003cspan class=\"pl-k\"\u003efor\u003c/span\u003e (\u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e; \u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e \u003cspan class=\"pl-s1 x x-first x-last\"\u003eclamped_nvalues2\u003c/span\u003e; \u003cspan class=\"pl-s1\"\u003ej\u003c/span\u003e\u003cspan class=\"pl-c1\"\u003e++\u003c/span\u003e)","displayNoNewLineWarning":false,"position":175,"left":2402,"right":2401},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2402,"text":" \t\t\t{","html":" \t\t\t{","displayNoNewLineWarning":false,"position":176,"left":2403,"right":2402},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2403,"text":" \t\t\t\tif (hasmatch2[j])","html":" \t\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003ehasmatch2\u003c/span\u003e[\u003cspan class=pl-s1\u003ej\u003c/span\u003e])","displayNoNewLineWarning":false,"position":177,"left":2404,"right":2403},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2404,"text":" \t\t\t\t\tcontinue;","html":" \t\t\t\t\t\u003cspan class=pl-k\u003econtinue\u003c/span\u003e;","displayNoNewLineWarning":false,"position":178,"left":2405,"right":2404},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2442,"text":"@@ -2444,7 +2443,7 @@ eqjoinsel_semi(Oid operator,","html":"@@ -2444,7 +2443,7 @@ eqjoinsel_semi(Oid operator,","displayNoNewLineWarning":false,"position":179,"left":2443,"right":2442},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2443,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":180,"left":2444,"right":2443},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2444,"text":" \t\t\tnd1 -= nmatches;","html":" \t\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e-=\u003c/span\u003e \u003cspan class=pl-s1\u003enmatches\u003c/span\u003e;","displayNoNewLineWarning":false,"position":181,"left":2445,"right":2444},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2445,"text":" \t\t\tnd2 -= nmatches;","html":" \t\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e-=\u003c/span\u003e \u003cspan class=pl-s1\u003enmatches\u003c/span\u003e;","displayNoNewLineWarning":false,"position":182,"left":2446,"right":2445},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2447,"text":"-\t\t\tif (nd1 \u003c= nd2 || nd2 \u003c= 0)","html":"-\t\t\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-s1\"\u003end1\u003c/span\u003e \u0026lt;= \u003cspan class=\"pl-s1\"\u003end2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e||\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003end2\u003c/span\u003e \u0026lt;\u003cspan class=\"x x-first x-last\"\u003e=\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":183,"left":2447,"right":2445},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2446,"text":"+\t\t\tif (nd1 \u003c= nd2 || nd2 \u003c 0)","html":"+\t\t\t\u003cspan class=\"pl-k\"\u003eif\u003c/span\u003e (\u003cspan class=\"pl-s1\"\u003end1\u003c/span\u003e \u0026lt;= \u003cspan class=\"pl-s1\"\u003end2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e||\u003c/span\u003e \u003cspan class=\"pl-s1\"\u003end2\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e\u0026lt;\u003c/span\u003e \u003cspan class=\"pl-c1\"\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":184,"left":2447,"right":2446},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2447,"text":" \t\t\t\tuncertainfrac = 1.0;","html":" \t\t\t\t\u003cspan class=pl-s1\u003euncertainfrac\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e1.0\u003c/span\u003e;","displayNoNewLineWarning":false,"position":185,"left":2448,"right":2447},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2448,"text":" \t\t\telse","html":" \t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":186,"left":2449,"right":2448},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2449,"text":" \t\t\t\tuncertainfrac = nd2 / nd1;","html":" \t\t\t\t\u003cspan class=pl-s1\u003euncertainfrac\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-s1\u003end2\u003c/span\u003e / \u003cspan class=pl-s1\u003end1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":187,"left":2450,"right":2449},{"stylingDirective":null,"type":"HUNK","blobLineNumber":2463,"text":"@@ -2465,14 +2464,7 @@ eqjoinsel_semi(Oid operator,","html":"@@ -2465,14 +2464,7 @@ eqjoinsel_semi(Oid operator,","displayNoNewLineWarning":false,"position":188,"left":2464,"right":2463},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2464,"text":" ","html":"\u003cbr\u003e","displayNoNewLineWarning":false,"position":189,"left":2465,"right":2464},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2465,"text":" \t\tif (nd1 != DEFAULT_NUM_DISTINCT \u0026\u0026 nd2 != DEFAULT_NUM_DISTINCT)","html":" \t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e!=\u003c/span\u003e \u003cspan class=pl-c1\u003eDEFAULT_NUM_DISTINCT\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026amp;\u0026amp;\u003c/span\u003e \u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e!=\u003c/span\u003e \u003cspan class=pl-c1\u003eDEFAULT_NUM_DISTINCT\u003c/span\u003e)","displayNoNewLineWarning":false,"position":190,"left":2466,"right":2465},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2466,"text":" \t\t{","html":" \t\t{","displayNoNewLineWarning":false,"position":191,"left":2467,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2468,"text":"-\t\t\tif (vardata1-\u003erel)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":192,"left":2468,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2469,"text":"-\t\t\t\tnd1 = Min(nd1, vardata1-\u003erel-\u003erows);","html":"-\t\t\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end1\u003c/span\u003e, \u003cspan class=pl-s1\u003evardata1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":193,"left":2469,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2470,"text":"-\t\t\tnd1 = Min(nd1, rel1-\u003erows);","html":"-\t\t\t\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end1\u003c/span\u003e, \u003cspan class=pl-s1\u003erel1\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":194,"left":2470,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2471,"text":"-\t\t\tif (vardata2-\u003erel)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e)","displayNoNewLineWarning":false,"position":195,"left":2471,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2472,"text":"-\t\t\t\tnd2 = Min(nd2, vardata2-\u003erel-\u003erows);","html":"-\t\t\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003evardata2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erel\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":196,"left":2472,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2473,"text":"-\t\t\tnd2 = Min(nd2, rel2-\u003erows);","html":"-\t\t\t\u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-en\u003eMin\u003c/span\u003e(\u003cspan class=pl-s1\u003end2\u003c/span\u003e, \u003cspan class=pl-s1\u003erel2\u003c/span\u003e\u003cspan class=pl-c1\u003e-\u0026gt;\u003c/span\u003e\u003cspan class=pl-c1\u003erows\u003c/span\u003e);","displayNoNewLineWarning":false,"position":197,"left":2473,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2474,"text":"-","html":"-","displayNoNewLineWarning":false,"position":198,"left":2474,"right":2466},{"stylingDirective":null,"type":"DELETION","blobLineNumber":2475,"text":"-\t\t\tif (nd1 \u003c= nd2 || nd2 \u003c= 0)","html":"-\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u0026lt;= \u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e||\u003c/span\u003e \u003cspan class=pl-s1\u003end2\u003c/span\u003e \u0026lt;= \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":199,"left":2475,"right":2466},{"stylingDirective":null,"type":"ADDITION","blobLineNumber":2467,"text":"+\t\t\tif (nd1 \u003c= nd2 || nd2 \u003c 0)","html":"+\t\t\t\u003cspan class=pl-k\u003eif\u003c/span\u003e (\u003cspan class=pl-s1\u003end1\u003c/span\u003e \u0026lt;= \u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e||\u003c/span\u003e \u003cspan class=pl-s1\u003end2\u003c/span\u003e \u003cspan class=pl-c1\u003e\u0026lt;\u003c/span\u003e \u003cspan class=pl-c1\u003e0\u003c/span\u003e)","displayNoNewLineWarning":false,"position":200,"left":2475,"right":2467},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2468,"text":" \t\t\t\tselec = 1.0 - nullfrac1;","html":" \t\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e \u003cspan class=pl-c1\u003e1.0\u003c/span\u003e \u003cspan class=pl-c1\u003e-\u003c/span\u003e \u003cspan class=pl-s1\u003enullfrac1\u003c/span\u003e;","displayNoNewLineWarning":false,"position":201,"left":2476,"right":2468},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2469,"text":" \t\t\telse","html":" \t\t\t\u003cspan class=pl-k\u003eelse\u003c/span\u003e","displayNoNewLineWarning":false,"position":202,"left":2477,"right":2469},{"stylingDirective":null,"type":"CONTEXT","blobLineNumber":2470,"text":" \t\t\t\tselec = (nd2 / nd1) * (1.0 - nullfrac1);","html":" \t\t\t\t\u003cspan class=pl-s1\u003eselec\u003c/span\u003e \u003cspan class=pl-c1\u003e=\u003c/span\u003e (\u003cspan class=pl-s1\u003end2\u003c/span\u003e / \u003cspan class=pl-s1\u003end1\u003c/span\u003e) \u003cspan class=pl-c1\u003e*\u003c/span\u003e (\u003cspan class=pl-c1\u003e1.0\u003c/span\u003e \u003cspan class=pl-c1\u003e-\u003c/span\u003e \u003cspan class=pl-s1\u003enullfrac1\u003c/span\u003e);","displayNoNewLineWarning":false,"position":203,"left":2478,"right":2470}],"diffNumber":0,"diffSize":"0 Bytes","isBinary":false,"isTooBig":false,"collapsed":false,"isSubmodule":false,"lineCount":6814,"linesChanged":108,"newTreeEntry":{"lineCount":6814,"path":"src/backend/utils/adt/selfuncs.c","mode":100644,"isGenerated":false},"oldTreeEntry":{"lineCount":0,"path":"src/backend/utils/adt/selfuncs.c","mode":100644},"linesAdded":50,"linesDeleted":58,"path":"src/backend/utils/adt/selfuncs.c","pathDigest":"60407b5c46aaf9ea36ed1002b1bfaf5e818298c30d3d680c4e9c91f814befd46","status":"MODIFIED","truncatedReason":null,"oldOid":"7971a57fd4ca4253393b77700d59670b5c6ec252","newOid":"0d3b231eebf41170f15605a943eb58e8d3d18374","copilotChatReference":null,"deletedSha":"7971a57fd4ca4253393b77700d59670b5c6ec252","canToggleRichDiff":false,"defaultToRichDiff":false,"proseDifffHtml":null,"renderInfo":null,"dependencyDiffPath":null,"submodule":null}],"splitViewPreference":"unified","ignoreWhitespace":false,"repoOwnerGlobalRelayId":"MDEyOk9yZ2FuaXphdGlvbjE3NzU0Mw==","commentsPreference":"visible","diffLineSpacingPreference":"relaxed","useMonospaceFont":false,"pasteUrlLinkAsPlainText":false,"userNotices":[],"path":"/postgres/postgres/commit/0d3b231eebf41170f15605a943eb58e8d3d18374","fileTreeExpanded":true,"headerInfo":{"additions":50,"deletions":58,"filesChanged":1,"filesChangedString":"1"},"moreDiffsToLoad":false,"asyncDiffLoadInfo":{"startIndex":1,"truncated":false,"byteCount":7385,"lineShownCount":204},"commentInfo":{"canComment":false,"locked":false,"canLock":false,"repoArchived":false},"csrf_tokens":{"/users/diffview?diff=split":{"post":"AYJn1ewBbdzr5wHpimocKrShsqFJGek83zmsA_0wHKcMkIWpqTS69pN6uPjxKBt_ZacT56vsPRLXuya3PMcgIQ"},"/users/diffview?diff=unified":{"post":"dRLaVDv2WeWP_Xv4uBetwHW95BM-sa1BvjJxMXzfSSN4ADgofsOOz_dgwunDVaqVpLtFVdxEeW-2sPuFvSh1pQ"},"/notifications/thread":{"post":"ZdOXVH6B3hPrJK_wgeDcrggzAN4oR1bNNyjNnBQSgCCq11iTjebr_oZk-ypmIZKliOQxzj7kHXWB-IXJ1knGnQ"}}},"title":"Further repair of eqjoinsel ndistinct-clamping logic. · postgres/postgres@0d3b231","appPayload":{"helpUrl":"https://docs.github.com","findInDiffWorkerPath":"/assets-cdn/worker/find-in-diff-worker-2bfe39677d14.js","enabled_features":{"diff_ux_refresh_beta":false,"diff_inline_comments":true,"diff_ux_refresh_ssr_five":false,"diff_ux_refresh_ssr_ten":false,"react_diff_line_type_character_correction":true}}}
Further repair of eqjoinsel ndistinct-clamping logic.
Examination of examples provided by Mark Kirkwood and others has convinced
me that actually commit 7f3eba3 was quite
a few bricks shy of a load. The useful part of that patch was clamping
ndistinct for the inner side of a semi or anti join, and the reason why
that's needed is that it's the only way that restriction clauses
eliminating rows from the inner relation can affect the estimated size of
the join result. I had not clearly understood why the clamping was
appropriate, and so mis-extrapolated to conclude that we should clamp
ndistinct for the outer side too, as well as for both sides of regular
joins. These latter actions were all wrong, and are reverted with this
patch. In addition, the clamping logic is now made to affect the behavior
of both paths in eqjoinsel_semi, with or without MCV lists to compare.
When we have MCVs, we suppose that the most common values are the ones
that are most likely to survive the decimation resulting from a lower
restriction clause, so we think of the clamping as eliminating non-MCV
values, or potentially even the least-common MCVs for the inner relation.
Back-patch to 8.4, same as previous fixes in this area.
0 commit comments