Submit a ticketCall us

Looking to compare latest NPM features with previous versions of NPM?
The NPM new feature summary offers a comparison of new features and improvements offered with this release.

 

Home > Success Center > Database Performance Analyzer (DPA) > SQL batches in MySQL affect statistics

SQL batches in MySQL affect statistics

Table of contents
Created by Anthony.Rinaldi, last modified by MindTouch on Jun 23, 2016

Views: 2 Votes: 0 Revisions: 2

Overview

MySQL only publishes the information necessary to retrieve statistics for the last query in a batch of SQL statements. This affects DPA's ability to accurately report statistics for some of the SQL in the batch.

Environment

  • All versions of DPA

Detail

As an example, take this batch of SQL statements:

SELECT count(1) FROM t1;SELECT count(1) FROM t2;SELECT count(1) FROM t3;

DPA appropriately reports wait time separately for each of the SQLs in this batch. However,statistics are only available for the last query in the batch:

SELECT count(1) FROM t3;

DPA can report partial statistics for SQL statements that are sometimes executed individually and sometimes in a batch. DPA collects statistics for the SQL statements executed individually, and those are the statistics that get reported.

If DPA is reporting the wait time only for sets of batched SQL statements, the MYSQL_JOIN_PROCESSLIST advanced option might be set to FALSE. If DPA is running in this mode, you won't see statistics for any of the individually executed batch SQL statements either.

 

 

Last modified
19:18, 22 Jun 2016

Tags

Classifications

Public