Tweaks the join reordering algorithm to prefer using bound variables

pull/21/head
Tpt 5 years ago
parent cf805ea3d1
commit 58fe455621
  1. 300
      bench/bsbm.explore.svg
  2. 16
      lib/src/sparql/plan_builder.rs

@ -27,354 +27,354 @@ z
" style="fill:#ffffff;"/> " style="fill:#ffffff;"/>
</g> </g>
<g id="patch_3"> <g id="patch_3">
<path clip-path="url(#p67969da4ac)" d="M 73.832727 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 73.832727 307.584
L 79.335347 307.584 L 79.335347 307.584
L 79.335347 251.012211 L 79.335347 251.315159
L 73.832727 251.012211 L 73.832727 251.315159
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_4"> <g id="patch_4">
<path clip-path="url(#p67969da4ac)" d="M 101.345824 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 101.345824 307.584
L 106.848444 307.584 L 106.848444 307.584
L 106.848444 239.522917 L 106.848444 239.887391
L 101.345824 239.522917 L 101.345824 239.887391
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_5"> <g id="patch_5">
<path clip-path="url(#p67969da4ac)" d="M 128.858921 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 128.858921 307.584
L 134.361541 307.584 L 134.361541 307.584
L 134.361541 238.467915 L 134.361541 238.838039
L 128.858921 238.467915 L 128.858921 238.838039
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_6"> <g id="patch_6">
<path clip-path="url(#p67969da4ac)" d="M 156.372018 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 156.372018 307.584
L 161.874638 307.584 L 161.874638 307.584
L 161.874638 230.035973 L 161.874638 230.451251
L 156.372018 230.035973 L 156.372018 230.451251
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_7"> <g id="patch_7">
<path clip-path="url(#p67969da4ac)" d="M 183.885116 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 183.885116 307.584
L 189.387735 307.584 L 189.387735 307.584
L 189.387735 131.686644 L 189.387735 132.628593
L 183.885116 131.686644 L 183.885116 132.628593
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_8"> <g id="patch_8">
<path clip-path="url(#p67969da4ac)" d="M 238.91131 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 238.91131 307.584
L 244.413929 307.584 L 244.413929 307.584
L 244.413929 253.060314 L 244.413929 253.352294
L 238.91131 253.060314 L 238.91131 253.352294
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_9"> <g id="patch_9">
<path clip-path="url(#p67969da4ac)" d="M 266.424407 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 266.424407 307.584
L 271.927026 307.584 L 271.927026 307.584
L 271.927026 241.094654 L 271.927026 241.450712
L 266.424407 241.094654 L 266.424407 241.450712
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_10"> <g id="patch_10">
<path clip-path="url(#p67969da4ac)" d="M 293.937504 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 293.937504 307.584
L 299.440123 307.584 L 299.440123 307.584
L 299.440123 267.294767 L 299.440123 267.51052
L 293.937504 267.294767 L 293.937504 267.51052
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_11"> <g id="patch_11">
<path clip-path="url(#p67969da4ac)" d="M 321.450601 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 321.450601 307.584
L 326.95322 307.584 L 326.95322 307.584
L 326.95322 236.592057 L 326.95322 236.972226
L 321.450601 236.592057 L 321.450601 236.972226
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_12"> <g id="patch_12">
<path clip-path="url(#p67969da4ac)" d="M 348.963698 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 348.963698 307.584
L 354.466317 307.584 L 354.466317 307.584
L 354.466317 268.557001 L 354.466317 268.765995
L 348.963698 268.557001 L 348.963698 268.765995
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_13"> <g id="patch_13">
<path clip-path="url(#p67969da4ac)" d="M 376.476795 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 376.476795 307.584
L 381.979414 307.584 L 381.979414 307.584
L 381.979414 254.847358 L 381.979414 255.129769
L 376.476795 254.847358 L 376.476795 255.129769
z z
" style="fill:#1f77b4;"/> " style="fill:#1f77b4;"/>
</g> </g>
<g id="patch_14"> <g id="patch_14">
<path clip-path="url(#p67969da4ac)" d="M 79.335347 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 79.335347 307.584
L 84.837966 307.584 L 84.837966 307.584
L 84.837966 304.295193 L 84.837966 304.312805
L 79.335347 304.295193 L 79.335347 304.312805
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_15"> <g id="patch_15">
<path clip-path="url(#p67969da4ac)" d="M 106.848444 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 106.848444 307.584
L 112.351063 307.584 L 112.351063 307.584
L 112.351063 300.861054 L 112.351063 300.897056
L 106.848444 300.861054 L 106.848444 300.897056
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_16"> <g id="patch_16">
<path clip-path="url(#p67969da4ac)" d="M 134.361541 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 134.361541 307.584
L 139.86416 307.584 L 139.86416 307.584
L 139.86416 303.614286 L 139.86416 303.635544
L 134.361541 303.614286 L 134.361541 303.635544
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_17"> <g id="patch_17">
<path clip-path="url(#p67969da4ac)" d="M 161.874638 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 161.874638 307.584
L 167.377257 307.584 L 167.377257 307.584
L 167.377257 303.25903 L 167.377257 303.282191
L 161.874638 303.25903 L 161.874638 303.282191
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_18"> <g id="patch_18">
<path clip-path="url(#p67969da4ac)" d="M 189.387735 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 189.387735 307.584
L 194.890354 307.584 L 194.890354 307.584
L 194.890354 273.958504 L 194.890354 274.138572
L 189.387735 273.958504 L 189.387735 274.138572
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_19"> <g id="patch_19">
<path clip-path="url(#p67969da4ac)" d="M 244.413929 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 244.413929 307.584
L 249.916549 307.584 L 249.916549 307.584
L 249.916549 301.213618 L 249.916549 301.247732
L 244.413929 301.213618 L 244.413929 301.247732
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_20"> <g id="patch_20">
<path clip-path="url(#p67969da4ac)" d="M 271.927026 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 271.927026 307.584
L 277.429646 307.584 L 277.429646 307.584
L 277.429646 302.357434 L 277.429646 302.385423
L 271.927026 302.357434 L 271.927026 302.385423
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_21"> <g id="patch_21">
<path clip-path="url(#p67969da4ac)" d="M 299.440123 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 299.440123 307.584
L 304.942743 307.584 L 304.942743 307.584
L 304.942743 304.688127 L 304.942743 304.703635
L 299.440123 304.688127 L 299.440123 304.703635
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_22"> <g id="patch_22">
<path clip-path="url(#p67969da4ac)" d="M 326.95322 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 326.95322 307.584
L 332.45584 307.584 L 332.45584 307.584
L 332.45584 303.331696 L 332.45584 303.354468
L 326.95322 303.331696 L 326.95322 303.354468
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_23"> <g id="patch_23">
<path clip-path="url(#p67969da4ac)" d="M 354.466317 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 354.466317 307.584
L 359.968937 307.584 L 359.968937 307.584
L 359.968937 304.610079 L 359.968937 304.626004
L 354.466317 304.610079 L 354.466317 304.626004
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_24"> <g id="patch_24">
<path clip-path="url(#p67969da4ac)" d="M 381.979414 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 381.979414 307.584
L 387.482034 307.584 L 387.482034 307.584
L 387.482034 304.338254 L 387.482034 304.355635
L 381.979414 304.338254 L 381.979414 304.355635
z z
" style="fill:#ff7f0e;"/> " style="fill:#ff7f0e;"/>
</g> </g>
<g id="patch_25"> <g id="patch_25">
<path clip-path="url(#p67969da4ac)" d="M 84.837966 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 84.837966 307.584
L 90.340586 307.584 L 90.340586 307.584
L 90.340586 303.302092 L 90.340586 300.747148
L 84.837966 303.302092 L 84.837966 300.747148
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_26"> <g id="patch_26">
<path clip-path="url(#p67969da4ac)" d="M 112.351063 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 112.351063 307.584
L 117.853683 307.584 L 117.853683 307.584
L 117.853683 276.886672 L 117.853683 271.014607
L 112.351063 276.886672 L 112.351063 271.014607
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_27"> <g id="patch_27">
<path clip-path="url(#p67969da4ac)" d="M 139.86416 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 139.86416 307.584
L 145.36678 307.584 L 145.36678 307.584
L 145.36678 299.310847 L 145.36678 295.347802
L 139.86416 299.310847 L 139.86416 295.347802
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_28"> <g id="patch_28">
<path clip-path="url(#p67969da4ac)" d="M 167.377257 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 167.377257 307.584
L 172.879877 307.584 L 172.879877 307.584
L 172.879877 289.274872 L 172.879877 288.727781
L 167.377257 289.274872 L 167.377257 288.727781
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_29"> <g id="patch_29">
<path clip-path="url(#p67969da4ac)" d="M 194.890354 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 194.890354 307.584
L 200.392974 307.584 L 200.392974 307.584
L 200.392974 98.707068 L 200.392974 54.144
L 194.890354 98.707068 L 194.890354 54.144
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_30"> <g id="patch_30">
<path clip-path="url(#p67969da4ac)" d="M 249.916549 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 249.916549 307.584
L 255.419168 307.584 L 255.419168 307.584
L 255.419168 234.810395 L 255.419168 269.970609
L 249.916549 234.810395 L 249.916549 269.970609
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_31"> <g id="patch_31">
<path clip-path="url(#p67969da4ac)" d="M 277.429646 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 277.429646 307.584
L 282.932265 307.584 L 282.932265 307.584
L 282.932265 267.593505 L 282.932265 289.375596
L 277.429646 267.593505 L 277.429646 289.375596
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_32"> <g id="patch_32">
<path clip-path="url(#p67969da4ac)" d="M 304.942743 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 304.942743 307.584
L 310.445362 307.584 L 310.445362 307.584
L 310.445362 305.600489 L 310.445362 305.894864
L 304.942743 305.600489 L 304.942743 305.894864
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_33"> <g id="patch_33">
<path clip-path="url(#p67969da4ac)" d="M 332.45584 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 332.45584 307.584
L 337.958459 307.584 L 337.958459 307.584
L 337.958459 54.144 L 337.958459 299.845027
L 332.45584 54.144 L 332.45584 299.845027
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_34"> <g id="patch_34">
<path clip-path="url(#p67969da4ac)" d="M 359.968937 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 359.968937 307.584
L 365.471556 307.584 L 365.471556 307.584
L 365.471556 305.086444 L 365.471556 304.146836
L 359.968937 305.086444 L 359.968937 304.146836
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_35"> <g id="patch_35">
<path clip-path="url(#p67969da4ac)" d="M 387.482034 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 387.482034 307.584
L 392.984653 307.584 L 392.984653 307.584
L 392.984653 282.01635 L 392.984653 294.670542
L 387.482034 282.01635 L 387.482034 294.670542
z z
" style="fill:#2ca02c;"/> " style="fill:#2ca02c;"/>
</g> </g>
<g id="patch_36"> <g id="patch_36">
<path clip-path="url(#p67969da4ac)" d="M 90.340586 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 90.340586 307.584
L 95.843205 307.584 L 95.843205 307.584
L 95.843205 297.892515 L 95.843205 297.944414
L 90.340586 297.892515 L 90.340586 297.944414
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_37"> <g id="patch_37">
<path clip-path="url(#p67969da4ac)" d="M 117.853683 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 117.853683 307.584
L 123.356302 307.584 L 123.356302 307.584
L 123.356302 268.481644 L 123.356302 268.691041
L 117.853683 268.481644 L 117.853683 268.691041
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_38"> <g id="patch_38">
<path clip-path="url(#p67969da4ac)" d="M 145.36678 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 145.36678 307.584
L 150.869399 307.584 L 150.869399 307.584
L 150.869399 294.28344 L 150.869399 294.354665
L 145.36678 294.28344 L 145.36678 294.354665
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_39"> <g id="patch_39">
<path clip-path="url(#p67969da4ac)" d="M 172.879877 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 172.879877 307.584
L 178.382496 307.584 L 178.382496 307.584
L 178.382496 269.633534 L 178.382496 269.836763
L 172.879877 269.633534 L 172.879877 269.836763
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_40"> <g id="patch_40">
<path clip-path="url(#p67969da4ac)" d="M 200.392974 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 200.392974 307.584
L 205.895593 307.584 L 205.895593 307.584
L 205.895593 290.058049 L 205.895593 290.151902
L 200.392974 290.058049 L 200.392974 290.151902
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_41"> <g id="patch_41">
<path clip-path="url(#p67969da4ac)" d="M 255.419168 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 255.419168 307.584
L 260.921787 307.584 L 260.921787 307.584
L 260.921787 273.382559 L 260.921787 273.565711
L 255.419168 273.382559 L 255.419168 273.565711
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_42"> <g id="patch_42">
<path clip-path="url(#p67969da4ac)" d="M 282.932265 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 282.932265 307.584
L 288.434884 307.584 L 288.434884 307.584
L 288.434884 287.611629 L 288.434884 287.718583
L 282.932265 287.611629 L 282.932265 287.718583
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_43"> <g id="patch_43">
<path clip-path="url(#p67969da4ac)" d="M 310.445362 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 310.445362 307.584
L 315.947982 307.584 L 315.947982 307.584
L 315.947982 303.167525 L 315.947982 303.191176
L 310.445362 303.167525 L 310.445362 303.191176
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_44"> <g id="patch_44">
<path clip-path="url(#p67969da4ac)" d="M 337.958459 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 337.958459 307.584
L 343.461079 307.584 L 343.461079 307.584
L 343.461079 281.101298 L 343.461079 281.243115
L 337.958459 281.101298 L 337.958459 281.243115
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_45"> <g id="patch_45">
<path clip-path="url(#p67969da4ac)" d="M 365.471556 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 365.471556 307.584
L 370.974176 307.584 L 370.974176 307.584
L 370.974176 303.506633 L 370.974176 303.528467
L 365.471556 303.506633 L 365.471556 303.528467
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
<g id="patch_46"> <g id="patch_46">
<path clip-path="url(#p67969da4ac)" d="M 392.984653 307.584 <path clip-path="url(#p3b05b9f86a)" d="M 392.984653 307.584
L 398.487273 307.584 L 398.487273 307.584
L 398.487273 291.928524 L 398.487273 292.012361
L 392.984653 291.928524 L 392.984653 292.012361
z z
" style="fill:#d62728;"/> " style="fill:#d62728;"/>
</g> </g>
@ -384,10 +384,10 @@ z
<defs> <defs>
<path d="M 0 0 <path d="M 0 0
L 0 3.5 L 0 3.5
" id="m61c3ce9532" style="stroke:#000000;stroke-width:0.8;"/> " id="m77ec045e3d" style="stroke:#000000;stroke-width:0.8;"/>
</defs> </defs>
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="109.599753" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="109.599753" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_1"> <g id="text_1">
@ -426,7 +426,7 @@ z
<g id="xtick_2"> <g id="xtick_2">
<g id="line2d_2"> <g id="line2d_2">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="164.625948" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="164.625948" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_2"> <g id="text_2">
@ -458,7 +458,7 @@ z
<g id="xtick_3"> <g id="xtick_3">
<g id="line2d_3"> <g id="line2d_3">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="219.652142" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="219.652142" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_3"> <g id="text_3">
@ -503,7 +503,7 @@ z
<g id="xtick_4"> <g id="xtick_4">
<g id="line2d_4"> <g id="line2d_4">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="274.678336" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="274.678336" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_4"> <g id="text_4">
@ -557,7 +557,7 @@ z
<g id="xtick_5"> <g id="xtick_5">
<g id="line2d_5"> <g id="line2d_5">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="329.70453" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="329.70453" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_5"> <g id="text_5">
@ -607,7 +607,7 @@ z
<g id="xtick_6"> <g id="xtick_6">
<g id="line2d_6"> <g id="line2d_6">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="384.730724" xlink:href="#m61c3ce9532" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="384.730724" xlink:href="#m77ec045e3d" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_6"> <g id="text_6">
@ -780,10 +780,10 @@ z
<defs> <defs>
<path d="M 0 0 <path d="M 0 0
L -3.5 0 L -3.5 0
" id="m14f0d3e4c8" style="stroke:#000000;stroke-width:0.8;"/> " id="mdd0da8bc57" style="stroke:#000000;stroke-width:0.8;"/>
</defs> </defs>
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#m14f0d3e4c8" y="307.584"/> <use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#mdd0da8bc57" y="307.584"/>
</g> </g>
</g> </g>
<g id="text_8"> <g id="text_8">
@ -807,12 +807,12 @@ z
<g id="ytick_2"> <g id="ytick_2">
<g id="line2d_8"> <g id="line2d_8">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#m14f0d3e4c8" y="253.757369"/> <use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#mdd0da8bc57" y="254.045616"/>
</g> </g>
</g> </g>
<g id="text_9"> <g id="text_9">
<!-- 0.02 --> <!-- 0.02 -->
<g transform="translate(28.334375 257.556588)scale(0.1 -0.1)"> <g transform="translate(28.334375 257.844835)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/> <use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/> <use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/> <use x="95.410156" xlink:href="#DejaVuSans-48"/>
@ -823,12 +823,12 @@ z
<g id="ytick_3"> <g id="ytick_3">
<g id="line2d_9"> <g id="line2d_9">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#m14f0d3e4c8" y="199.930738"/> <use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#mdd0da8bc57" y="200.507233"/>
</g> </g>
</g> </g>
<g id="text_10"> <g id="text_10">
<!-- 0.04 --> <!-- 0.04 -->
<g transform="translate(28.334375 203.729957)scale(0.1 -0.1)"> <g transform="translate(28.334375 204.306452)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/> <use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/> <use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/> <use x="95.410156" xlink:href="#DejaVuSans-48"/>
@ -839,12 +839,12 @@ z
<g id="ytick_4"> <g id="ytick_4">
<g id="line2d_10"> <g id="line2d_10">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#m14f0d3e4c8" y="146.104107"/> <use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#mdd0da8bc57" y="146.968849"/>
</g> </g>
</g> </g>
<g id="text_11"> <g id="text_11">
<!-- 0.06 --> <!-- 0.06 -->
<g transform="translate(28.334375 149.903326)scale(0.1 -0.1)"> <g transform="translate(28.334375 150.768068)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/> <use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/> <use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/> <use x="95.410156" xlink:href="#DejaVuSans-48"/>
@ -855,12 +855,12 @@ z
<g id="ytick_5"> <g id="ytick_5">
<g id="line2d_11"> <g id="line2d_11">
<g> <g>
<use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#m14f0d3e4c8" y="92.277477"/> <use style="stroke:#000000;stroke-width:0.8;" x="57.6" xlink:href="#mdd0da8bc57" y="93.430466"/>
</g> </g>
</g> </g>
<g id="text_12"> <g id="text_12">
<!-- 0.08 --> <!-- 0.08 -->
<g transform="translate(28.334375 96.076695)scale(0.1 -0.1)"> <g transform="translate(28.334375 97.229685)scale(0.1 -0.1)">
<use xlink:href="#DejaVuSans-48"/> <use xlink:href="#DejaVuSans-48"/>
<use x="63.623047" xlink:href="#DejaVuSans-46"/> <use x="63.623047" xlink:href="#DejaVuSans-46"/>
<use x="95.410156" xlink:href="#DejaVuSans-48"/> <use x="95.410156" xlink:href="#DejaVuSans-48"/>
@ -1492,7 +1492,7 @@ z
</g> </g>
</g> </g>
<defs> <defs>
<clipPath id="p67969da4ac"> <clipPath id="p3b05b9f86a">
<rect height="266.112" width="357.12" x="57.6" y="41.472"/> <rect height="266.112" width="357.12" x="57.6" y="41.472"/>
</clipPath> </clipPath>
</defs> </defs>

Before

Width:  |  Height:  |  Size: 44 KiB

After

Width:  |  Height:  |  Size: 44 KiB

@ -934,25 +934,31 @@ fn count_pattern_binds(
pattern: &TripleOrPathPattern, pattern: &TripleOrPathPattern,
assigned_variables: &HashSet<&Variable>, assigned_variables: &HashSet<&Variable>,
) -> u8 { ) -> u8 {
let mut count = 3; let mut count = 12;
if let TermOrVariable::Variable(v) = pattern.subject() { if let TermOrVariable::Variable(v) = pattern.subject() {
if !assigned_variables.contains(v) { if !assigned_variables.contains(v) {
count -= 1; count -= 4;
} }
} else {
count -= 1;
} }
if let TripleOrPathPattern::Triple(t) = pattern { if let TripleOrPathPattern::Triple(t) = pattern {
if let NamedNodeOrVariable::Variable(v) = &t.predicate { if let NamedNodeOrVariable::Variable(v) = &t.predicate {
if !assigned_variables.contains(v) { if !assigned_variables.contains(v) {
count -= 1; count -= 4;
}
} }
} else { } else {
count -= 1; count -= 1;
} }
} else {
count -= 3;
}
if let TermOrVariable::Variable(v) = pattern.object() { if let TermOrVariable::Variable(v) = pattern.object() {
if !assigned_variables.contains(v) { if !assigned_variables.contains(v) {
count -= 1; count -= 4;
} }
} else {
count -= 1;
} }
count count
} }

Loading…
Cancel
Save