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

Fix timing in the final QueryResult for create fts/hnsw index #4915

Merged
merged 4 commits into from
Feb 16, 2025

Conversation

ray6080
Copy link
Contributor

@ray6080 ray6080 commented Feb 15, 2025

Description

Create fts/hnsw index invokes the rewrite mechanism, thus a single query expands into multiple statements, but only the last statement's execution result is visible to users (others are internal and their execution results are indivisible to users unless there are errors encountered). This causes a gap between the execution/compiling time of the last statement and the actual one for the whole query.
To fix the gap, this PR collects compiling/execution time for all internal statements and aggregate them into the final query result, which is visible to users.

Copy link

Benchmark Result

Master commit hash: 0e61d7391827730cb6df21ce4abd40b02e227171
Branch commit hash: c0a1762742df3d66a3a4cb9f858f60808a28931e

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 715.28 725.06 -9.77 (-1.35%)
aggregation q28 6356.76 6365.47 -8.71 (-0.14%)
filter q14 117.63 127.96 -10.33 (-8.07%)
filter q15 115.74 125.90 -10.16 (-8.07%)
filter q16 295.69 302.95 -7.26 (-2.40%)
filter q17 440.22 447.74 -7.52 (-1.68%)
filter q18 1910.14 1927.66 -17.52 (-0.91%)
filter zonemap-node 80.80 88.86 -8.06 (-9.08%)
filter zonemap-node-lhs-cast 80.46 89.13 -8.66 (-9.72%)
filter zonemap-node-null 80.34 90.69 -10.35 (-11.42%)
filter zonemap-rel 5504.42 5604.53 -100.11 (-1.79%)
fixed_size_expr_evaluator q07 564.54 571.83 -7.29 (-1.27%)
fixed_size_expr_evaluator q08 794.99 802.87 -7.88 (-0.98%)
fixed_size_expr_evaluator q09 792.31 799.89 -7.57 (-0.95%)
fixed_size_expr_evaluator q10 229.07 236.77 -7.70 (-3.25%)
fixed_size_expr_evaluator q11 222.89 231.22 -8.33 (-3.60%)
fixed_size_expr_evaluator q12 217.86 227.30 -9.44 (-4.15%)
fixed_size_expr_evaluator q13 1461.22 1449.45 11.77 (0.81%)
fixed_size_seq_scan q23 103.33 110.52 -7.19 (-6.51%)
join q29 791.86 713.01 78.84 (11.06%)
join q30 10116.68 10109.53 7.15 (0.07%)
join q31 7.77 7.46 0.31 (4.09%)
join SelectiveTwoHopJoin 57.05 58.13 -1.07 (-1.84%)
ldbc_snb_ic q35 2615.01 2680.25 -65.24 (-2.43%)
ldbc_snb_ic q36 471.53 477.54 -6.01 (-1.26%)
ldbc_snb_is q32 6.68 3.90 2.78 (71.42%)
ldbc_snb_is q33 15.88 12.09 3.79 (31.35%)
ldbc_snb_is q34 1.23 1.14 0.09 (7.69%)
multi-rel multi-rel-large-scan 1319.84 1372.62 -52.78 (-3.84%)
multi-rel multi-rel-lookup 32.56 10.87 21.69 (199.54%)
multi-rel multi-rel-small-scan 98.74 96.04 2.70 (2.81%)
order_by q25 125.36 136.56 -11.20 (-8.20%)
order_by q26 438.38 451.63 -13.25 (-2.93%)
order_by q27 1401.84 1413.47 -11.63 (-0.82%)
recursive_join recursive-join-bidirection 304.07 293.37 10.70 (3.65%)
recursive_join recursive-join-dense 6331.91 7358.13 -1026.21 (-13.95%)
recursive_join recursive-join-path 24065.12 24082.51 -17.39 (-0.07%)
recursive_join recursive-join-sparse 1052.18 1056.68 -4.50 (-0.43%)
recursive_join recursive-join-trail 7226.54 7316.10 -89.56 (-1.22%)
scan_after_filter q01 163.28 173.03 -9.75 (-5.63%)
scan_after_filter q02 147.83 159.90 -12.08 (-7.55%)
shortest_path_ldbc100 q37 99.66 88.39 11.27 (12.75%)
shortest_path_ldbc100 q38 385.98 352.52 33.47 (9.49%)
shortest_path_ldbc100 q39 66.13 65.89 0.24 (0.37%)
shortest_path_ldbc100 q40 459.15 443.60 15.55 (3.51%)
var_size_expr_evaluator q03 2041.79 2102.24 -60.45 (-2.88%)
var_size_expr_evaluator q04 2192.73 2202.42 -9.70 (-0.44%)
var_size_expr_evaluator q05 2649.15 2673.80 -24.65 (-0.92%)
var_size_expr_evaluator q06 1318.49 1339.30 -20.81 (-1.55%)
var_size_seq_scan q19 1437.79 1453.15 -15.35 (-1.06%)
var_size_seq_scan q20 2438.93 2538.69 -99.75 (-3.93%)
var_size_seq_scan q21 2277.27 2321.33 -44.07 (-1.90%)
var_size_seq_scan q22 124.72 127.85 -3.13 (-2.45%)

Copy link

codecov bot commented Feb 16, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 86.53%. Comparing base (db8f5ae) to head (c99c4d8).
Report is 1 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff           @@
##           master    #4915   +/-   ##
=======================================
  Coverage   86.53%   86.53%           
=======================================
  Files        1403     1403           
  Lines       60695    60706   +11     
  Branches     7472     7473    +1     
=======================================
+ Hits        52520    52533   +13     
+ Misses       8006     8004    -2     
  Partials      169      169           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

Benchmark Result

Master commit hash: db8f5ae2bb2cf2ca704db16384bc530e3857678b
Branch commit hash: 636a5539cea9a00a26c0fffee9653a4da13611d8

Query Group Query Name Mean Time - Commit (ms) Mean Time - Master (ms) Diff
aggregation q24 722.81 740.23 -17.42 (-2.35%)
aggregation q28 6356.03 6360.16 -4.13 (-0.06%)
filter q14 128.30 142.78 -14.48 (-10.14%)
filter q15 125.45 141.68 -16.23 (-11.46%)
filter q16 307.32 319.31 -12.00 (-3.76%)
filter q17 448.48 462.30 -13.83 (-2.99%)
filter q18 1932.19 1961.14 -28.95 (-1.48%)
filter zonemap-node 89.72 105.22 -15.50 (-14.73%)
filter zonemap-node-lhs-cast 89.28 105.70 -16.42 (-15.53%)
filter zonemap-node-null 88.79 105.50 -16.71 (-15.84%)
filter zonemap-rel 5544.69 5555.37 -10.68 (-0.19%)
fixed_size_expr_evaluator q07 581.85 590.30 -8.46 (-1.43%)
fixed_size_expr_evaluator q08 811.81 822.11 -10.30 (-1.25%)
fixed_size_expr_evaluator q09 812.55 819.71 -7.16 (-0.87%)
fixed_size_expr_evaluator q10 245.55 253.61 -8.06 (-3.18%)
fixed_size_expr_evaluator q11 238.56 245.68 -7.12 (-2.90%)
fixed_size_expr_evaluator q12 235.84 242.66 -6.82 (-2.81%)
fixed_size_expr_evaluator q13 1460.08 1468.66 -8.58 (-0.58%)
fixed_size_seq_scan q23 119.30 129.71 -10.41 (-8.02%)
join q29 726.60 718.43 8.17 (1.14%)
join q30 10589.68 10706.56 -116.89 (-1.09%)
join q31 5.92 5.86 0.05 (0.90%)
join SelectiveTwoHopJoin 59.63 55.87 3.76 (6.73%)
ldbc_snb_ic q35 2605.20 2670.37 -65.16 (-2.44%)
ldbc_snb_ic q36 487.18 490.57 -3.40 (-0.69%)
ldbc_snb_is q32 6.31 6.06 0.25 (4.13%)
ldbc_snb_is q33 14.32 15.24 -0.92 (-6.04%)
ldbc_snb_is q34 1.14 1.22 -0.08 (-6.72%)
multi-rel multi-rel-large-scan 1778.31 1293.24 485.07 (37.51%)
multi-rel multi-rel-lookup 10.27 18.67 -8.40 (-45.01%)
multi-rel multi-rel-small-scan 69.90 89.45 -19.55 (-21.86%)
order_by q25 131.01 146.80 -15.79 (-10.76%)
order_by q26 446.72 501.24 -54.51 (-10.88%)
order_by q27 1435.55 1426.20 9.34 (0.66%)
recursive_join recursive-join-bidirection 311.97 312.09 -0.12 (-0.04%)
recursive_join recursive-join-dense 7391.05 7419.63 -28.58 (-0.39%)
recursive_join recursive-join-path 24167.93 24167.93 -0.00 (-0.00%)
recursive_join recursive-join-sparse 1053.73 1049.03 4.70 (0.45%)
recursive_join recursive-join-trail 7372.28 7390.56 -18.29 (-0.25%)
scan_after_filter q01 172.04 187.00 -14.96 (-8.00%)
scan_after_filter q02 157.09 175.09 -17.99 (-10.28%)
shortest_path_ldbc100 q37 97.02 90.01 7.01 (7.79%)
shortest_path_ldbc100 q38 380.56 344.19 36.38 (10.57%)
shortest_path_ldbc100 q39 62.36 66.26 -3.90 (-5.89%)
shortest_path_ldbc100 q40 471.33 422.97 48.37 (11.43%)
var_size_expr_evaluator q03 2078.32 2061.69 16.63 (0.81%)
var_size_expr_evaluator q04 2220.19 2298.66 -78.47 (-3.41%)
var_size_expr_evaluator q05 2637.73 2628.30 9.43 (0.36%)
var_size_expr_evaluator q06 1345.03 1368.83 -23.80 (-1.74%)
var_size_seq_scan q19 1452.71 1450.17 2.54 (0.18%)
var_size_seq_scan q20 2466.20 2442.71 23.50 (0.96%)
var_size_seq_scan q21 2295.84 2314.06 -18.23 (-0.79%)
var_size_seq_scan q22 126.50 129.12 -2.62 (-2.03%)

@ray6080 ray6080 merged commit 43e3616 into master Feb 16, 2025
23 of 25 checks passed
@ray6080 ray6080 deleted the rewrite-timing branch February 16, 2025 14:37
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