p4 dbstat

Display size or simple statistics for one or more database tables.

Syntax

p4 [g-opts] dbstat [-h][-f] | [-p [-w worklevel] [-n numberOfFiles]] {-a | dbtable ...}
p4 [g-opts] dbstat -s

Syntax conventions

Description

The p4 dbstat command displays statistics on the internal state of the database on the Helix Server. The dbtable corresponds to the db.* files in your server’s root directory. This command is typically used in conjunction with Perforce technical support to estimate disk seeks due to sequential database scans.

Using the -f with the -h options, a histogram of free page distribution is shown, but the distance report is omitted.

To obtain size information, use p4 dbstat -s.

Warning

Because p4 dbstat blocks write access to the database while it scans the tables, use this command with care. You will most often use this command when working with Perforce technical support.

To tune future checkpoint requests

If your Helix Core Server contains a few tables that are significantly larger than its average-sized table, you might be able to reduce the amount of time needed to complete checkpoints.

  1. Use the -p, -w, and -numberOfFiles options to determine how a multifile parallel checkpoint splits the database tables. For example, to get a report about the computed number of files, the page gap, and the keys generated for the db.nameval table, you might try:

    p4 dbstat -p -w 2 -numberOfFiles 3 db.nameval

    The output is a quick heuristic overview of the depth and page count of the B-tree associated with the specified database table.

  2. Use that information to tune future checkpoints by setting values for the following configurables: db.checkpoint.reqlevel, db.checkpoint.worklevel, db.checkpoint.numfiles, and db.checkpoint.threads. See both

    in Helix Core Server Administrator Guide.

Options

-a

Display statistics for all tables.

-f

Displays a page count, free pages, and percent free data for the specified table(s).

-h

Display a histogram showing distances between leaf pages.

-s

Report file sizes of database tables.

-p

Requests level and page count information for a database table. Included in the output are details of how the file would be split for a multifile checkpoint request.

Warning

This option requires significant compute resources for any large tables. We recommend that you consider the alternative that splits large tables into multiple files. See Parallel checkpointing, dumping and recovery in Helix Core Server Administrator Guide.

-w worklevel Overrides the db.checkpoint.worklevel configurable so you can specify the worklevel at the command line.
-n numberOfFiles Overrides the db.checkpoint.numfiles configurable so you can specify numberOfFiles at the command line.

dbtable

Display statistics for the specified table (for instance, db.have, db.user, and so on.) As you are most likely to need data for a particular table when working with support, they will let you know the name of the table for which you need information.

g-opts

See Global options.

Usage Notes

Can File Arguments Use Revision Specifier? Can File Arguments Use Revision Range? Minimal Access Level Required

N/A

N/A

super

available to an operator user