Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add rel filter to projected graph #4932

Merged
merged 2 commits into from
Feb 20, 2025
Merged

Conversation

andyfengHKU
Copy link
Contributor

@andyfengHKU andyfengHKU commented Feb 19, 2025

Description

This PR adds relationship table filter to projected graph. An example can be found in the following

CALL create_projected_graph('PK2', ['person'], {'knows': {'filter': 'r.date > date("1999-01-01")'}})

It's a bit weird that we need to write r.date > ... instead of date > ... but it's the simplest one. Also Neo4j has a very similar grammar.

This PR also renames project_graph to projected_graph

@andyfengHKU andyfengHKU requested a review from ray6080 February 19, 2025 15:27
Copy link

Benchmark Result

Master commit hash: 7d2e7db54dcaa7cc91da72f808624fa369f76617
Branch commit hash: 673927031fdf8f3e639b4f34f35af396b16dfd91

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 722.64 725.31 -2.66 (-0.37%)
aggregation q28 6363.13 6362.11 1.02 (0.02%)
filter q14 125.86 126.20 -0.34 (-0.27%)
filter q15 127.03 124.11 2.92 (2.35%)
filter q16 310.94 304.75 6.19 (2.03%)
filter q17 447.83 444.97 2.86 (0.64%)
filter q18 1888.80 1906.37 -17.58 (-0.92%)
filter zonemap-node 88.98 88.85 0.12 (0.14%)
filter zonemap-node-lhs-cast 89.07 88.73 0.33 (0.37%)
filter zonemap-node-null 88.77 89.46 -0.70 (-0.78%)
filter zonemap-rel 5548.51 5899.97 -351.46 (-5.96%)
fixed_size_expr_evaluator q07 572.18 575.19 -3.01 (-0.52%)
fixed_size_expr_evaluator q08 804.89 804.96 -0.07 (-0.01%)
fixed_size_expr_evaluator q09 801.03 808.27 -7.23 (-0.90%)
fixed_size_expr_evaluator q10 236.89 237.87 -0.98 (-0.41%)
fixed_size_expr_evaluator q11 229.77 229.18 0.59 (0.26%)
fixed_size_expr_evaluator q12 226.18 226.48 -0.30 (-0.13%)
fixed_size_expr_evaluator q13 1459.09 1467.66 -8.57 (-0.58%)
fixed_size_seq_scan q23 112.42 117.20 -4.78 (-4.08%)
join q29 710.20 778.08 -67.88 (-8.72%)
join q30 10315.15 9934.27 380.87 (3.83%)
join q31 6.78 6.75 0.03 (0.49%)
join SelectiveTwoHopJoin 51.70 58.45 -6.75 (-11.55%)
ldbc_snb_ic q35 2604.36 2669.54 -65.19 (-2.44%)
ldbc_snb_ic q36 475.68 492.18 -16.50 (-3.35%)
ldbc_snb_is q32 6.88 6.51 0.37 (5.67%)
ldbc_snb_is q33 15.37 15.89 -0.52 (-3.29%)
ldbc_snb_is q34 1.33 1.27 0.06 (4.44%)
multi-rel multi-rel-large-scan 1465.22 1351.72 113.50 (8.40%)
multi-rel multi-rel-lookup 25.78 30.94 -5.16 (-16.67%)
multi-rel multi-rel-small-scan 106.37 71.33 35.04 (49.13%)
order_by q25 132.69 130.91 1.78 (1.36%)
order_by q26 446.10 448.72 -2.62 (-0.58%)
order_by q27 1400.51 1403.75 -3.25 (-0.23%)
recursive_join recursive-join-bidirection 330.27 283.33 46.95 (16.57%)
recursive_join recursive-join-dense 7096.82 7084.06 12.76 (0.18%)
recursive_join recursive-join-path 23815.95 23829.73 -13.78 (-0.06%)
recursive_join recursive-join-sparse 1059.41 1063.29 -3.88 (-0.36%)
recursive_join recursive-join-trail 7022.37 7042.07 -19.70 (-0.28%)
scan_after_filter q01 171.17 170.95 0.22 (0.13%)
scan_after_filter q02 157.09 157.00 0.10 (0.06%)
shortest_path_ldbc100 q37 89.75 86.63 3.12 (3.60%)
shortest_path_ldbc100 q38 381.03 368.53 12.50 (3.39%)
shortest_path_ldbc100 q39 65.70 64.42 1.29 (2.00%)
shortest_path_ldbc100 q40 466.55 436.81 29.74 (6.81%)
var_size_expr_evaluator q03 2127.10 2082.83 44.27 (2.13%)
var_size_expr_evaluator q04 2209.78 2189.04 20.74 (0.95%)
var_size_expr_evaluator q05 3015.69 2634.12 381.57 (14.49%)
var_size_expr_evaluator q06 1484.87 1322.14 162.73 (12.31%)
var_size_seq_scan q19 1458.00 1468.55 -10.55 (-0.72%)
var_size_seq_scan q20 2705.64 2514.94 190.70 (7.58%)
var_size_seq_scan q21 2410.73 2317.04 93.69 (4.04%)
var_size_seq_scan q22 127.40 126.56 0.84 (0.67%)

@andyfengHKU andyfengHKU force-pushed the rel-filtered-project-graph branch from de73476 to 3779bcb Compare February 20, 2025 07:42
Copy link

Benchmark Result

Master commit hash: bf8c8b88cbdeb1a10e58e53a07a156ea72932d40
Branch commit hash: e66e65d24c1bfcd7223af03060a0becda0e59989

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 736.64 722.70 13.94 (1.93%)
aggregation q28 6387.13 6396.89 -9.76 (-0.15%)
filter q14 127.54 130.34 -2.79 (-2.14%)
filter q15 123.16 125.08 -1.93 (-1.54%)
filter q16 304.60 306.73 -2.12 (-0.69%)
filter q17 445.62 448.03 -2.41 (-0.54%)
filter q18 1932.78 1934.88 -2.10 (-0.11%)
filter zonemap-node 89.43 94.15 -4.72 (-5.02%)
filter zonemap-node-lhs-cast 89.02 90.39 -1.36 (-1.51%)
filter zonemap-node-null 88.97 89.94 -0.97 (-1.08%)
filter zonemap-rel 5606.43 5587.69 18.75 (0.34%)
fixed_size_expr_evaluator q07 571.82 570.73 1.09 (0.19%)
fixed_size_expr_evaluator q08 802.33 801.53 0.80 (0.10%)
fixed_size_expr_evaluator q09 801.67 800.49 1.18 (0.15%)
fixed_size_expr_evaluator q10 238.28 236.62 1.66 (0.70%)
fixed_size_expr_evaluator q11 229.87 230.25 -0.39 (-0.17%)
fixed_size_expr_evaluator q12 226.53 226.52 0.01 (0.00%)
fixed_size_expr_evaluator q13 1458.50 1458.46 0.04 (0.00%)
fixed_size_seq_scan q23 108.28 108.92 -0.63 (-0.58%)
join q29 738.48 768.96 -30.49 (-3.96%)
join q30 9795.40 11630.24 -1834.85 (-15.78%)
join q31 7.55 8.94 -1.39 (-15.53%)
join SelectiveTwoHopJoin 55.91 57.24 -1.32 (-2.31%)
ldbc_snb_ic q35 2678.13 2621.22 56.91 (2.17%)
ldbc_snb_ic q36 463.11 484.63 -21.52 (-4.44%)
ldbc_snb_is q32 6.05 5.68 0.36 (6.40%)
ldbc_snb_is q33 16.32 15.43 0.89 (5.79%)
ldbc_snb_is q34 1.30 1.20 0.10 (8.78%)
multi-rel multi-rel-large-scan 1371.02 1499.32 -128.30 (-8.56%)
multi-rel multi-rel-lookup 21.23 44.94 -23.71 (-52.76%)
multi-rel multi-rel-small-scan 98.59 88.16 10.44 (11.84%)
order_by q25 132.44 134.53 -2.09 (-1.56%)
order_by q26 461.15 461.64 -0.49 (-0.11%)
order_by q27 1413.41 1407.49 5.92 (0.42%)
recursive_join recursive-join-bidirection 322.84 305.79 17.05 (5.58%)
recursive_join recursive-join-dense 7075.12 7092.58 -17.46 (-0.25%)
recursive_join recursive-join-path 23499.84 23969.41 -469.57 (-1.96%)
recursive_join recursive-join-sparse 1061.05 1047.42 13.63 (1.30%)
recursive_join recursive-join-trail 7054.55 7036.01 18.53 (0.26%)
scan_after_filter q01 173.28 172.68 0.59 (0.34%)
scan_after_filter q02 158.05 157.25 0.81 (0.51%)
shortest_path_ldbc100 q37 89.01 82.22 6.79 (8.25%)
shortest_path_ldbc100 q38 383.05 325.19 57.86 (17.79%)
shortest_path_ldbc100 q39 69.55 60.50 9.05 (14.96%)
shortest_path_ldbc100 q40 439.43 299.15 140.27 (46.89%)
var_size_expr_evaluator q03 2097.41 2073.31 24.10 (1.16%)
var_size_expr_evaluator q04 2224.59 2212.19 12.40 (0.56%)
var_size_expr_evaluator q05 2637.09 2644.54 -7.45 (-0.28%)
var_size_expr_evaluator q06 1327.33 1329.93 -2.60 (-0.20%)
var_size_seq_scan q19 1467.39 1470.74 -3.35 (-0.23%)
var_size_seq_scan q20 2516.48 2772.24 -255.76 (-9.23%)
var_size_seq_scan q21 2319.74 2392.45 -72.71 (-3.04%)
var_size_seq_scan q22 124.49 125.08 -0.59 (-0.47%)

@andyfengHKU andyfengHKU merged commit 5d4664a into master Feb 20, 2025
@andyfengHKU andyfengHKU deleted the rel-filtered-project-graph branch February 20, 2025 09:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants