Sampling Profiler Results - Database Structure

Applies to AQTime 8.81, last modified on January 18, 2022

When you export the Sampling profiler results to a database, AQTime creates a number of tables in it. The contents of most of these tables correspond to the contents of AQTime panels in which the profiling results are displayed. This topic describes the structure of the database table that contains the exported Sampling profiler results.

The database consists of the following tables:

The relations between the mentioned tables are illustrated in the image below. The relations are similar to those of data in AQTime’s Explorer, Report and Details panels that hold the Sampling profiler results.

Relationship between database tables

Click the image to enlarge it.

The root table of the database is the INSTANCES table. It contains a list of all exported result sets and is shared by AQTime’s profilers. Each result set is identified by the INST_ID field value which is unique in the table. All other database tables also have the INST_ID field that indicates the result set to which data of a specific table item belongs.

The Sampling profiler results that are displayed in the Report panel depend on the category selected in the Explorer panel - Routines, Source Files or Modules. In the database, profiling information for routines, source files and modules is stored in the separate SAMPLING_PROFILER_ROUTINES, SAMPLING_PROFILER_SOURCE_FILES and SAMPLING_PROFILER_MODULES tables, respectively. Since AQTime traces routine calls by threads, the database contains a special SAMPLING_PROFILER_THREADS table that holds a list of application threads traced by the Sampling profiler. The SAMPLING_PROFILER_ROUTINES, SAMPLING_PROFILER_SOURCE_FILES and SAMPLING_PROFILER_MODULES tables, in their turn, have the PARENT_ID field that indicates the thread where a specific routine call was made.

The SAMPLING_PROFILER_ROUTINES table holds the SAMPLING_PROFILER_LINES table which contains profiling information for the routine’s individual lines. This is the same information that is displayed in the Lines table of AQTime’s Details panel when the Report panel displays profiling data for routines. To identify the routine to which a specific SAMPLING_PROFILER_LINES table item is related, these tables have the PARENT_ID field that holds the identifier of the related routine.

The database tables that have the META suffix in their names contain meta information about the profiled elements - routines and source files. This data is retrieved from the application’s debug information and from the setup information of the AQTime project.

Note: The ID and REC_ID columns of the SAMPLING_PROFILER_xxxx tables are not key columns. They may contain repetitive values. In queries you should use these values along with the INST_ID value (the result set identifier).

Below is detailed information about the tables.

The INSTANCES table

This table contains a list of exported result sets. Each result set is identified by the INST_ID value.

Field Name Description
CAPTION String. The name of the result set. This is the same name that is displayed in the Explorer panel.
COUNTER_DESCRIPTION String. Reserved.
COUNTER_FREQUENCY Decimal. Reserved.
COUNTER_NAME String. Reserved.
INST_ID Integer. The result set’s identifier.

The RELATIONS table

This table contains information about parent-child relations between database tables holding Sampling profiler results.

Field Name Description
COL_CHILD_TABLE String. The name of a child table.
COL_PARENT_TABLE String. The name of a parent table. The NULL value means that the table specified by the COL_CHILD_TABLE is a top-level table.
ID Integer. The identifier of a specific relation within the RELATIONS table.
INST_ID Integer. The identifier of the INSTANCES table item corresponding to the result set whose data the tables hold.

The SAMPLING_PROFILER_LINES table

This table contains profiling information on routines’s individual lines. Fields of this table correspond to columns of the Lines table of the Details panel.

Field Name Description
COL___PROFILED_CODE Floating point. This field corresponds to the % Profiled Code column of the Details panel displaying the Sampling profiler results when the Routines category is selected in the Explorer panel. It stores the percentage of the sample count for the given line against the total sample count for the given function.
COL_SAMPLE_COUNT Integer. This field stores the number of samples collected for the line during profiling. It corresponds to the Sample Count column of the Details panel displaying the Sampling profiler results when the Routines category is selected in the Explorer panel.
COL_SHADOW_TIME Floating point. Reserved.
ID Integer. The line’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_LINES table item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Integer. The identifier of the routine to which the line belongs. This is the same value as the routine’s ID value in the SAMPLING_PROFILER_ROUTINES table.
REC_ID Integer. The line’s identifier within the routine’s lines list.

The SAMPLING_PROFILER_META_ROUTINES table

This table contains information about routines of the profiled application. It is retrieved from the application’s debug information and from the setup information of the AQTime project. Fields of this table, along with the SAMPLING_PROFILER_ROUTINES table fields, correspond to columns of the Report panel that displays profiling results for routines.

Field Name Description
COL_FILE_NAME String. The fully-qualified name of the source file.
COL_MODULE_NAME String. The fully-qualified name of the module.
COL_ROUTINE_NAME String. The fully-qualified name of the routine.
COL_SOURCE_LINE Integer. The line number in the source file where the routine’s implementation begins.
COL_SYMBOL_MONIKER String. The routine’s moniker.
ID Integer. The routine’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_META_ROUTINES table item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Not used. Always contains -1.
REC_ID Integer. The line’s identifier within the routine’s lines list.

The SAMPLING_PROFILER_META_SOURCE_FILES table

This table contains information about source files of the profiled application.

Field Name Description
COL_FILE_NAME String. The source file name.
COL_SYMBOL_MONIKER String. The source file’s moniker.
ID Integer. The source file’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_META_SOURCE_FILES table item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Not used. Always contains -1.
REC_ID Integer. The source file’s identifier within the source files list.

The SAMPLING_PROFILER_MODULES table

This table contains profiling results for each module of your application. Fields of this table correspond to the Report panel columns displaying Sampling profiler results when the Modules category is selected in the Explorer panel.

Field Name Description
COL___TOTAL Floating point. This field corresponds to the % Total column of the Report panel displaying the Sampling profiler results. It stores the percentage of the sample count for the functions of the given module against the total number of samples simulated during profiling.
COL_MODULE_NAME String. The module name. This field corresponds to the Module Name column of the Report panel.
COL_SAMPLE_COUNT Integer. This field stores the number of samples collected for the routines of the given module during profiling. It corresponds to the Sample Count column of the Report panel displaying the Sampling profiler results.
ID Integer. The module’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_MODULES table item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Integer. The identifier of the thread in which the module’s routines were called. This is the same value as the thread’s ID value in the SAMPLING_PROFILER_THREADS table.
REC_ID Integer. Reserved.

The SAMPLING_PROFILER_ROUTINES table

This table contains profiling information on the application’s routines. Fields of this table correspond to the Report panel columns when the Routines category is selected in the Explorer panel.

Field Name Description
COL___PROFILED_CODE Floating point. This field stores the percentage of the sample count for the given routine against the total sample count for all the profiled functions. It corresponds to the % Profiled Code column of the Report panel.
COL___TOTAL Floating point. This field stores the percentage of the sample count for the given routine against the total number of samples simulated during profiling. It corresponds to the % Total column of the Report panel displaying the Sampling profiler results.
COL_FILE_NAME String. The name of the source file containing the profiled routine. This field corresponds to the File Name column of the Report panel.
COL_METAROWINDEXCOLUMN Integer. Reserved.
COL_MODULE_NAME String. The name of the module that contains the profiled routine. This field corresponds to the Module Name column of the Report panel.
COL_ROUTINE_NAME String. The routine name. This field corresponds to the Routine Name column of the Report panel.
COL_SAMPLE_COUNT Integer. The sample count for the given routine.
COL_SHADOW_TIME Floating point. Reserved.
COL_SOURCE_LINE Integer. The source file’s line number where the routine implementation begins. This field corresponds to the Source Line column of the Report panel.
ID Integer. The routine’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_ROUTINES item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Integer. The identifier of the thread where the routine was called. This is the same value as the thread’s ID value in the SAMPLING_PROFILER_THREADS table.
REC_ID Integer. The routine’s identifier within the list of routines called from the PARENT_ID thread.

The SAMPLING_PROFILER_SOURCE_FILES table

This table contains profiling information on source files of the profiled application. Fields of this table correspond to the Report panel columns when the Source Files category is selected in the Explorer panel.

Field Name Description
COL_FILE_NAME String. The source file name. This field corresponds to the File Name column of the Report panel.
COL_SAMPLE_COUNT Integer. The sample count collected for all routines of the given source file.
COL_METAROWINDEXCOLUMN Integer. Reserved.
COL___TOTAL Floating point. This field stores the percentage of the sample count for the routines of the given source file against the total number of samples simulated during profiling. It corresponds to the % Total column of the Report panel displaying the Sampling profiler results.
ID Integer. The source file’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_SOURCE_FILES table item belongs. This is the same value as the result set’s INST_ID value in the INSTANCES table.
PARENT_ID Integer. The identifier of the thread where the routines defined in the source file were called. This is the same value as the thread’s ID value in the SAMPLING_PROFILER_THREADS table.
REC_ID Integer. The source file’s identifier within the list of files whose routines were called in the PARENT_ID thread.

The SAMPLING_PROFILER_THREADS table

This table contains information about application threads that were profiled with the Sampling profiler. The information in this table corresponds to the list of profiled threads displayed in the Explorer panel.

Field Name Description
COL_NAME String. The thread name. This is the same name that is displayed in the Explorer panel.
COL_WIN32THREADID Integer. The thread’s identifier. This field is used only for Win32 threads.
ID The thread’s identifier within the result set.
INST_ID Integer. The identifier of the result set to which the given SAMPLING_PROFILER_THREADS table item belongs. This is the same value as the results’ INST_ID value in the INSTANCES table.
PARENT_ID Not used. Always contains -1.
REC_ID Integer. Reserved.

See Also

Exporting Profiling Results to Database
Sampling Profiler - Overview
Sampling Profiler Panels Reference

Highlight search results