Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[DRAFT] refactor query graph and enable profiling for a connection#140

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
guillesd wants to merge5 commits intoduckdb:main
base:main
Choose a base branch
Loading
fromguillesd:update_query_graph

Conversation

@guillesd
Copy link
Collaborator

@guillesdguillesd commentedOct 22, 2025
edited
Loading

The idea of this PR is to make this tool a bit more useful (and visually appealing). I think generally it is good to have some better profiling tools to explore queries.

EDIT: Initially it was only about the query graph visuals, but I decided to expose the profiling functions enabled in the C++ API (similar to what the Go client does with the C API).

To use the tool:

  1. Build this branch (seehttps://duckdb.org/docs/stable/dev/building/python)
  2. Run the following in DuckDB
PRAGMA enable_profiling='json';PRAGMA profiling_output='./tmp/profile.json';SELECT ...FROM ...;
  1. Run the script (I do it with uv):
uv run python -m duckdb.query_graph tmp/complex_profile.json

If you want to use the profiling within the client:

importduckdbcon=duckdb.connect()con.enable_profiling()con.execute("select 42").fetchall()#or some other eager operationprofile_info=con.get_profiling_information()# optionallycon.disable_profiling()

WIP: Now you can exposetranslate_json_to_html from duckdb.query_graph and do everything within the python process natively:

fromduckdb.query_graphimporttranslate_json_to_html#maybe some better naming heretranslate_json_to_html(input_text=profile_info,output_file='tmp/profile.html')

Which should yield something like the following screenshot:
Screenshot 2025-10-22 at 17 18 02

teserak, miguelduarte18, taniabogatsch, and artjomPlaunov reacted with heart emoji
@guillesdguillesd marked this pull request as draftOctober 22, 2025 15:19
@guillesdguillesd changed the title[DRAFT] refactor query graph to make it more useful[DRAFT] refactor query graph and enable profiling for a connectionOct 24, 2025
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@evertlammertsevertlammertsAwaiting requested review from evertlammerts

At least 1 approving review is required to merge this pull request.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@guillesd

[8]ページ先頭

©2009-2025 Movatter.jp