DBIPROF(1p)

πŸ’– DBIPROF β€” the 1p manual page, bestie edition πŸ’–

okay so. this is dbiprof, a command-line client for DBI::ProfileData, living in the User Contributed Perl Documentation corner of the 1p section. it's the lil bestie you call when you wanna know which of your queries is out here wasting your whole entire life. πŸ•΅οΈβ™€οΈβœ¨


✨ NAME ✨

dbiprof β€” command-line client for DBI::ProfileData πŸ’…


🌸 SYNOPSIS 🌸

Wanna see a report of the ten queries with the longest total runtime in the profile dump file prof1.out? say less:

dbiprof prof1.out

Wanna see the top 10 most frequently run queries in the profile file dbi.prof (which is, btw, the default)? boom:

dbiprof --sort count

And the same report but with 15 entries? okay queen, expand your vision:

dbiprof --sort count --number 15

πŸ¦‹ DESCRIPTION πŸ¦‹

So the way this works: this tool is a command-line client for the DBI::ProfileData. it lets you analyze the profile data file produced by DBI::ProfileDumper and produce various useful reports. that's it, that's the whole vibe. it's giving "detective but make it perl". πŸ”πŸ’œ


πŸ‘‘ OPTIONS πŸ‘‘

This program accepts the following options, and yes bestie we're going through every single one, no skimming:

  • --number N β€” produce this many items in the report. defaults to 10. and if you set it to "all" then all results are shown, every last one, the whole buffet. πŸ“
  • --sort field β€” sort results by the given field. sorting by multiple fields isn't currently supported (patches welcome β€” they literally said it, not me). the available sort fields are:
    • total β€” sorts by total time run time across all runs. this is the default sort, the main character. ⭐
    • longest β€” sorts by the longest single run.
    • count β€” sorts by total number of runs.
    • first β€” sorts by the time taken in the first run.
    • shortest β€” sorts by the shortest single run.
    • key1 β€” sorts by the value of the first element in the Path, which should be numeric. you can also sort by "key2" and "key3". slay, options within options. 🌈
  • --reverse β€” reverses the selected sort. for example, to see a report of the shortest overall time:
dbiprof --sort total --reverse
  • --match keyN=value β€” consider only items where the specified key matches the given value. keys are numbered from 1. for example, let's say you used a DBI::Profile Path of:
[ DBIprofile_Statement, DBIprofile_Methodname ]

and called dbiprof as in:

dbiprof --match key2=execute

your report would only show execute queries, leaving out prepares, fetches, etc. like a filter but make it fashion. πŸŽ€

if the value given starts and ends with slashes ("/") then it will be treated as a regular expression. for example, to only include SELECT queries where key1 is the statement:

dbiprof --match key1=/^SELECT/

by default the match expression is matched case-insensitively, but this can be changed with the --case-sensitive option. iykyk. πŸ™ˆ

  • --exclude keyN=value β€” remove items for where the specified key matches the given value. for example, to exclude all prepare entries where key2 is the method name:
dbiprof --exclude key2=prepare

like "--match", if the value given starts and ends with slashes ("/") then it will be treated as a regular expression. for example, to exclude UPDATE queries where key1 is the statement:

dbiprof --match key1=/^UPDATE/

by default the exclude expression is matched case-insensitively, but this can be changed with the --case-sensitive option.

  • --case-sensitive β€” using this option causes --match and --exclude to work case-sensitively. defaults to off. capital letters MATTER now. πŸ’€
  • --delete β€” sets the "DeleteFiles" option to DBI::ProfileData which causes the files to be deleted after reading. see DBI::ProfileData for more details. (yes this really deletes them, no cap β€” go read the docs, bestie. 😭)
  • --dumpnodes β€” print the list of nodes in the form of a perl data structure. use the "-sort" option if you want the list sorted. raw data main character energy. πŸ”₯
  • --version β€” print the dbiprof version number and exit. a lil mic drop and out. πŸ‘‘

🫢 AUTHOR 🫢

Sam Tregar <sam@tregar.com> β€” the icon, the legend, the moment. πŸ’œ


Copyright (C) 2002 Sam Tregar

This program is free software; you can redistribute it and/or modify it under the same terms as Perl 5 itself.


⭐ SEE ALSO ⭐

DBI::ProfileDumper, DBI::Profile, DBI. the whole friend group, go say hi. πŸ¦‹


and that's the page bestie!! written for perl v5.42.3, dated 2026-08-19, and stamped DBIPROF(1p) right at the top where it belongs. now go profile something and find out which query is lowkey ruining your life. πŸ’–βœ¨πŸŽ€

πŸ“¦ where this page comes from