duckdb icon indicating copy to clipboard operation
duckdb copied to clipboard

Begin Profiling Rework to move towards Modularity

Open maiadegraaf opened this issue 2 years ago • 2 comments

Had to open a new PR but it is the same as #10935.

This PR introduces a new pragma custom_profiling_settings which accepts a path to a JSON file. The file can be used to turn on or off profiling settings when the profiling mode is set to JSON (PRAGMA enable_profiling = 'json';). If the pragma is not set, all profiling information will be included.

Currently, the settings are as follows:

  • CPU Timing: The total CPU time spent by that operator and its children.
  • Operator Cardinality: The number of rows returned by that operator
  • Operator Timing: The time spent by that operator
  • Extra Info: Any other information collected during the operation

An example of a custom profiling settings JSON file:

PRAGMA custom_profiling_settings='/path/to/settings.json'
{
  "cpu_time":"true",
  "operator_cardinality":"true",
}

The plan is to expand this feature to be able to include more settings in the future, as well as a new function in the C API that returns an object with the profiling information.

maiadegraaf avatar Mar 12 '24 09:03 maiadegraaf

Waiting for https://github.com/duckdb/duckdb/pull/11082 to be merged

maiadegraaf avatar Mar 15 '24 09:03 maiadegraaf

Waiting on https://github.com/duckdb/duckdb/pull/11868. @maiadegraaf, please ping me once this is ready for review!

taniabogatsch avatar May 07 '24 12:05 taniabogatsch

https://github.com/duckdb/duckdb/pull/11868 has been superseded by https://github.com/duckdb/duckdb/pull/11998 so this should be unblocked now!

Maxxen avatar May 14 '24 10:05 Maxxen

Still waiting on merging main into feature to unlock the new JSON features.

taniabogatsch avatar May 21 '24 06:05 taniabogatsch

The CI failure seems unrelated.

Its because I changed the name of certain proponents in the profiling, I updated the script so should work from now on. Just fails in the CI on this PR.

maiadegraaf avatar May 23 '24 14:05 maiadegraaf

Thanks!

Mytherin avatar May 23 '24 14:05 Mytherin