Skip to content

Sql debug cmd#8920

Merged
max-hoffman merged 11 commits intomainfrom
max/sql-debug-cmd
Mar 7, 2025
Merged

Sql debug cmd#8920
max-hoffman merged 11 commits intomainfrom
max/sql-debug-cmd

Conversation

@max-hoffman
Copy link
Copy Markdown
Contributor

@max-hoffman max-hoffman commented Mar 3, 2025

use:

 > dolt debug --output debug --time 10 -q "select * from table"
starting cpu profile...
starting mem profile...
starting trace profile...
debug results in: /var/folders/f7/0hsvdb9j0q71y3742k64jfn80000gn/T/dolt-debug-1522503989
zipped results in: debug.tar.gz

 > ls /var/folders/f7/0hsvdb9j0q71y3742k64jfn80000gn/T/dolt-debug-1522503989
analysis.txt        exec.txt       mem.pprof               trace.out
cpu.pprof           input.sql     plan.txt
  • cpu.pprof = CPU profile, run for at least time seconds (query loops if necessary)
  • mem.pprof = memory profile, run for at least time seconds (query loops if necessary)
  • trace.out = trace profile, run for at least time seconds (query loops if necessary)
  • input.sql = input query (select * from table)
  • analysis.txt = debug analysis output, includes memo and index cost estimations
  • plan.txt = simple and verbose plan output
  • exec.txt = accumulated stdout/stderr for all queries/background work

note:

  • fails if server mode is running, having this be a stored procedure would be quite a bit more work
  • lightly tested, queries with errors, larger scripts with DML/DDL probably do not profile smoothly

@max-hoffman max-hoffman changed the title Max/sql debug cmd Sql debug cmd Mar 3, 2025
@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
b5aa110 ok 5937457
version total_tests
b5aa110 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
f7ac3f9 ok 5937457
version total_tests
f7ac3f9 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
0858f52 ok 5937457
version total_tests
0858f52 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
6c86e77 ok 5937457
version total_tests
6c86e77 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
ab6409f ok 5937457
version total_tests
ab6409f 5937457
correctness_percentage
100.0

@coffeegoddd
Copy link
Copy Markdown
Contributor

@max-hoffman DOLT

comparing_percentages
100.000000 to 100.000000
version result total
e81b10c ok 5937457
version total_tests
e81b10c 5937457
correctness_percentage
100.0

@max-hoffman max-hoffman merged commit 51eb059 into main Mar 7, 2025
21 checks passed
@max-hoffman max-hoffman deleted the max/sql-debug-cmd branch March 7, 2025 20:12
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2025

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.07 1.14
batching batch sql 10000 1 0.09 1.44
batching by line sql 10000 1 0.11 1.09
blob 1 blob 200000 1 0.94 3.66 4.39
blob 2 blobs 200000 1 0.92 4.18 4.54
blob no blob 200000 1 0.93 2.38 2.8
col type datetime 200000 1 0.81 2.47 2.74
col type varchar 200000 1 0.71 3.3 3.72
config width 2 cols 200000 1 0.95 2.11 2.42
config width 32 cols 200000 1 1.87 2.02 2.77
config width 8 cols 200000 1 0.98 2.37 2.66
pk type float 200000 1 0.82 2.49 2.78
pk type int 200000 1 0.83 2.58 2.75
pk type varchar 200000 1 2.91 0.89 1.02
row count 1.6mm 1600000 1 5.87 2.89 2.83
row count 400k 400000 1 1.54 2.66 2.84
row count 800k 800000 1 2.92 2.87 2.9
secondary index four index 200000 1 3.57 1.41 1.35
secondary index no secondary 200000 1 0.95 2.34 2.68
secondary index one index 200000 1 1.2 2.29 2.42
secondary index two index 200000 1 2.04 1.74 1.81
sorting shuffled 1mm 1000000 0 5.21 2.79 2.62
sorting sorted 1mm 1000000 1 5.04 2.87 2.72

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2025

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.2
dolt_blame_commit_filter system table 2.97
dolt_commit_ancestors_commit_filter system table 0.58
dolt_commits_commit_filter system table 1
dolt_diff_log_join_from_commit system table 2.76
dolt_diff_log_join_to_commit system table 2.73
dolt_diff_table_from_commit_filter system table 1.18
dolt_diff_table_to_commit_filter system table 1.11
dolt_diffs_commit_filter system table 1.03
dolt_history_commit_filter system table 1.24
dolt_log_commit_filter system table 1.05

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 8, 2025

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 1.11
adds_updates_deletes 60000 60000 60000 4.54
deletes_only 0 60000 0 2.45
updates_only 0 0 60000 3.04

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2025

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.06 1.33
batching batch sql 10000 1 0.09 1.33
batching by line sql 10000 1 0.11 1.09
blob 1 blob 200000 1 0.89 3.91 4.72
blob 2 blobs 200000 1 0.85 4.62 4.94
blob no blob 200000 1 1.06 2.08 2.41
col type datetime 200000 1 0.79 2.52 2.84
col type varchar 200000 1 0.7 3.46 3.8
config width 2 cols 200000 1 0.94 2.13 2.4
config width 32 cols 200000 1 1.86 2.05 2.8
config width 8 cols 200000 1 0.97 2.39 2.75
pk type float 200000 1 0.88 2.33 2.65
pk type int 200000 1 1.01 2 2.19
pk type varchar 200000 1 2.77 1.01 0.97
row count 1.6mm 1600000 1 5.69 2.99 2.94
row count 400k 400000 1 1.55 2.63 2.74
row count 800k 800000 1 2.87 2.92 2.88
secondary index four index 200000 1 3.6 1.4 1.29
secondary index no secondary 200000 1 0.93 2.35 2.76
secondary index one index 200000 1 1.12 2.55 2.59
secondary index two index 200000 1 2.04 1.74 1.81
sorting shuffled 1mm 1000000 0 5.36 2.79 2.64
sorting sorted 1mm 1000000 1 5.29 2.82 2.71

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2025

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.17
dolt_blame_commit_filter system table 2.94
dolt_commit_ancestors_commit_filter system table 0.65
dolt_commits_commit_filter system table 1
dolt_diff_log_join_from_commit system table 2.76
dolt_diff_log_join_to_commit system table 2.73
dolt_diff_table_from_commit_filter system table 1.14
dolt_diff_table_to_commit_filter system table 1.14
dolt_diffs_commit_filter system table 1
dolt_history_commit_filter system table 1.3
dolt_log_commit_filter system table 1.05

@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 9, 2025

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 1.11
adds_updates_deletes 60000 60000 60000 4.59
deletes_only 0 60000 0 2.43
updates_only 0 0 60000 3.05

@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

test_name detail row_cnt sorted mysql_time sql_mult cli_mult
batching LOAD DATA 10000 1 0.08 1
batching batch sql 10000 1 0.07 1.71
batching by line sql 10000 1 0.09 1.33
blob 1 blob 200000 1 0.92 3.73 4.36
blob 2 blobs 200000 1 0.86 4.47 4.84
blob no blob 200000 1 0.96 2.34 2.69
col type datetime 200000 1 0.79 2.57 2.81
col type varchar 200000 1 0.71 3.25 3.68
config width 2 cols 200000 1 0.81 2.49 2.73
config width 32 cols 200000 1 1.89 1.98 2.74
config width 8 cols 200000 1 0.96 2.43 2.71
pk type float 200000 1 0.85 2.39 3.2
pk type int 200000 1 0.89 2.27 2.63
pk type varchar 200000 1 1.47 1.77 1.84
row count 1.6mm 1600000 1 5.85 2.91 2.85
row count 400k 400000 1 1.59 2.62 2.67
row count 800k 800000 1 2.85 2.93 2.94
secondary index four index 200000 1 3.67 1.37 1.28
secondary index no secondary 200000 1 0.95 2.31 2.65
secondary index one index 200000 1 1.16 2.36 2.45
secondary index two index 200000 1 1.98 1.77 1.86
sorting shuffled 1mm 1000000 0 4.91 2.92 2.75
sorting sorted 1mm 1000000 1 4.95 2.93 2.72

@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

name detail mean_mult
dolt_blame_basic system table 1.2
dolt_blame_commit_filter system table 2.96
dolt_commit_ancestors_commit_filter system table 0.66
dolt_commits_commit_filter system table 1.05
dolt_diff_log_join_from_commit system table 2.79
dolt_diff_log_join_to_commit system table 2.73
dolt_diff_table_from_commit_filter system table 1.13
dolt_diff_table_to_commit_filter system table 1.19
dolt_diffs_commit_filter system table 1
dolt_history_commit_filter system table 1.35
dolt_log_commit_filter system table 1.1

@github-actions
Copy link
Copy Markdown

@coffeegoddd DOLT

name add_cnt delete_cnt update_cnt latency
adds_only 60000 0 0 1.11
adds_updates_deletes 60000 60000 60000 4.83
deletes_only 0 60000 0 2.46
updates_only 0 0 60000 3.09

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants