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

Sql debug cmd #8920

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open

Sql debug cmd #8920

wants to merge 8 commits into from

Conversation

max-hoffman
Copy link
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
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
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
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
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

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