File: stats.xml

package info (click to toggle)
php-doc 20241205~git.dfcbb86%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: trixie
  • size: 70,956 kB
  • sloc: xml: 968,269; php: 23,883; javascript: 671; sh: 177; makefile: 37
file content (1651 lines) | stat: -rw-r--r-- 56,991 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
<?xml version="1.0" encoding="utf-8"?>
<chapter xml:id="mysqlnd.stats" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
 <title>Statistics</title>

 <para>
  MySQL Native Driver contains support for gathering statistics on the
  communication between the client and the server. The statistics
  gathered are of two main types:
  <itemizedlist>
   <listitem>
    <simpara>Client statistics</simpara>
   </listitem>
   <listitem>
    <simpara>Connection statistics</simpara>
   </listitem>
  </itemizedlist>
 </para>
 <para>
  When using the <link linkend="book.mysqli">mysqli</link> extension,
  these statistics can be obtained through two API calls:
  <itemizedlist>
   <listitem>
    <simpara><function>mysqli_get_client_stats</function></simpara>
   </listitem>
   <listitem>
    <simpara><function>mysqli_get_connection_stats</function></simpara>
   </listitem>
  </itemizedlist>
 </para>

 <note>
  <simpara>
   Statistics are aggregated among all extensions that use the MySQL Native
   Driver.
   For example, if the <link linkend="book.mysqli">mysqli</link>
   extension and the PDO MySQL driver are both set-up to use MySQLnd,
   then function calls from <link linkend="book.mysqli">mysqli</link>
   and method calls from PDO will affect the statistics.
  </simpara>
  <simpara>
   There is no way to find out how much a certain API call of any extension
   that has been compiled against MySQL Native Driver has impacted a certain
   statistic.
  </simpara>
 </note>

 <section xml:id="mysqlnd.stats.retrieve" annotations="chunk:false">
  <title>Retrieving statistics</title>

  <simpara>
   Client statistics can be retrieved by calling the
   <function>mysqli_get_client_stats</function> function.
  </simpara>

  <simpara>
   Connection statistics can be retrieved by calling the
   <function>mysqli_get_connection_stats</function> function.
  </simpara>

  <simpara>
   Both functions return an associative array,
   where the name of a statistic is the key for the corresponding
   statistical data.
  </simpara>
 </section>

 <section xml:id="mysqlnd.stats.statistics" annotations="chunk:false">
  <title>MySQL Native Driver Statistics</title>
  <simpara>
   Most statistics are associated to a connection, but some are associated
   to the process in which case this will be mentioned.
   <!-- Process running the server? -->
  </simpara>
  <simpara>
   The following statistics are produced by the MySQL Native Driver:
  </simpara>

  <variablelist>
   <title>Network Related Statistics</title>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-sent">
    <term><literal>bytes_sent</literal></term>
    <listitem>
     <simpara>
      Number of bytes sent from PHP to the MySQL server.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received">
    <term><literal>bytes_received</literal></term>
    <listitem>
     <simpara>
      Number of bytes received from the MySQL server.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-sent">
    <term><literal>packets_sent</literal></term>
    <listitem>
     <simpara>
      Number of packets sent by the MySQL Client Server protocol.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received">
    <term><literal>packets_received</literal></term>
    <listitem>
     <simpara>
      Number of packets received from the MySQL Client Server protocol.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.protocol-overhead-in">
    <term><literal>protocol_overhead_in</literal></term>
    <listitem>
     <simpara>
      MySQL Client Server protocol overhead in bytes for incoming traffic.
      Currently only the Packet Header (4 bytes) is considered as overhead.
      <code>protocol_overhead_in = packets_received * 4</code>
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.protocol-overhead-out">
    <term><literal>protocol_overhead_out</literal></term>
    <listitem>
     <simpara>
      MySQL Client Server protocol overhead in bytes for outgoing traffic.
      Currently only the Packet Header (4 bytes) is considered as overhead.
      <code>protocol_overhead_out = packets_received * 4</code>
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-ok-packet">
    <term><literal>bytes_received_ok_packet</literal></term>
    <listitem>
     <simpara>
      Total size of bytes of MySQL Client Server protocol OK packets received.
      OK packets can contain a status message.
      The length of the status message can vary and thus the size of an OK
      packet is not fixed.
     </simpara>
     <note>
      <simpara>
       The total size in bytes includes the size of the header packet
       (4 bytes, see protocol overhead).
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-ok">
    <term><literal>packets_received_ok</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol OK packets received.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-eof-packet">
    <term><literal>bytes_received_eof_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol EOF packets received.
      EOF can vary in size depending on the server version.
      Also, EOF can transport an error message.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-eof">
    <term><literal>packets_received_eof</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol EOF packets.
     </simpara>
     <simpara>
      Like with other packet statistics the number of packets will be
      increased even if PHP does not receive the expected packet but,
      for example, an error message.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-rset-header-packet">
    <term><literal>bytes_received_rset_header_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol result set header
      packets.
      The size of the packets varies depending on the payload
      (<literal>LOAD LOCAL INFILE</literal>, <literal>INSERT</literal>,
      <literal>UPDATE</literal>, <literal>SELECT</literal>, error message).
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-rset-header">
    <term><literal>packets_received_rset_header</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol result set header packets.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-rset-field-meta-packet">
    <term><literal>bytes_received_rset_field_meta_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol result set metadata
      (field information) packets.
      Of course the size varies with the fields in the result set.
      The packet may also transport an error or an EOF packet in case of
      COM_LIST_FIELDS.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-rset-field-meta">
    <term><literal>packets_received_rset_field_meta</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol result set metadata
      (field information) packets.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-rset-row-packet">
    <term><literal>bytes_received_rset_row_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol result set row data
      packets.
      The packet may also transport an error or an EOF packet.
      One can compute the number of error and EOF packets by subtracting
      <literal>rows_fetched_from_server_normal</literal>
      and <literal>rows_fetched_from_server_ps</literal>
      from <literal>bytes_received_rset_row_packet</literal>.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-rset-row">
    <term><literal>packets_received_rset_row</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol result set row data packets.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-prepare-response-packet">
    <term><literal>bytes_received_prepare_response_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol OK for Prepared
      Statement Initialization packets (prepared statement init packets).
      The packet may also transport an error.
      The packet size depends on the MySQL version.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-prepare-response">
    <term><literal>packets_received_prepare_response</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol OK for Prepared Statement
      Initialization packets (prepared statement init packets).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-change-user-packet">
    <term><literal>bytes_received_change_user_packet</literal></term>
    <listitem>
     <simpara>
      Total size in bytes of MySQL Client Server protocol COM_CHANGE_USER packets.
      The packet may also transport an error or EOF.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.bytes-received-ok-packet')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-received-change-user">
    <term><literal>packets_received_change_user</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol COM_CHANGE_USER packets.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.packets-sent-command">
    <term><literal>packets_sent_command</literal></term>
    <listitem>
     <simpara>
      Number of MySQL Client Server protocol commands sent from PHP to MySQL.
     </simpara>
     <simpara>
      There is no way to know which specific commands and how many of
      them have been sent.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-real-data_normal">
    <term><literal>bytes_received_real_data_normal</literal></term>
    <listitem>
     <simpara>
      Number of bytes of payload fetched by the PHP client from
      <literal>mysqlnd</literal> using the text protocol.
     </simpara>
     <simpara>
      This is the size of the actual data contained in result sets that do not
      originate from prepared statements and which have been fetched by the PHP client.
     </simpara>
     <simpara>
      Note that although a full result set may have been pulled from MySQL
      by <literal>mysqlnd</literal>, this statistic only counts actual data
      pulled from <literal>mysqlnd</literal> by the PHP client.
     </simpara>
     <para>
      An example of a code sequence that will increase the value is as follows:
      <programlisting>
<![CDATA[
$mysqli = new mysqli();
$res = $mysqli->query("SELECT 'abc'");
$res->fetch_assoc();
$res->close();
]]>
      </programlisting>
      Every fetch operation will increase the value.
     </para>
     <para>
      However, the statistic will not be increased if the result set is only
      buffered on the client, but not fetched, such as in the following example:
      <programlisting>
<![CDATA[
$mysqli = new mysqli();
$res = $mysqli->query("SELECT 'abc'");
$res->close();
]]>
      </programlisting>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bytes-received-real-data-ps">
    <term><literal>bytes_received_real_data_ps</literal></term>
    <listitem>
     <simpara>
      Number of bytes of the payload fetched by the PHP client from
      <literal>mysqlnd</literal> using the prepared statement protocol.
     </simpara>
     <simpara>
      This is the size of the actual data contained in result sets that
      originate from prepared statements and which have been fetched by the PHP client.
     </simpara>
     <simpara>
      The value will not be increased if the result set is not subsequently read by the PHP client.
     </simpara>
     <simpara>
      Note that although a full result set may have been pulled from MySQL
      by <literal>mysqlnd</literal>, this statistic only counts actual data
      pulled from <literal>mysqlnd</literal> by the PHP client.
     </simpara>
     <simpara>
      See also <literal>bytes_received_real_data_normal</literal>.
     </simpara>
    </listitem>
   </varlistentry>
  </variablelist>

  <variablelist>
   <title>Result Set Related Statistics</title>

   <varlistentry xml:id="mysqlnd.stats.statistics.result-set-queries">
    <term><literal>result_set_queries</literal></term>
    <listitem>
     <simpara>
      Number of queries that have generated a result set.
      Examples of queries that generate a result set:
      <literal>SELECT</literal>, <literal>SHOW</literal>.
     </simpara>
     <simpara>
      The statistic will not be incremented if there is an error reading
      the result set header packet from the line.
     </simpara>
     <note>
      <simpara>
       This statistic can be used as an indirect measure for the number of
       queries PHP has sent to MySQL.
       This could help identifying a client that causes a high database load.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.non-result-set-queries">
    <term><literal>non_result_set_queries</literal></term>
    <listitem>
     <simpara>
      Number of queries that did not generate a result set.
      Examples of queries that do not generate a result set:
      <literal>INSERT</literal>, <literal>UPDATE</literal>, <literal>LOAD DATA</literal>.
     </simpara>
     <simpara>
      The statistic will not be incremented if there is an error reading
      the result set header packet from the line.
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.result-set-queries')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.no-index-used">
    <term><literal>no_index_used</literal></term>
    <listitem>
     <simpara>
      Number of queries that have generated a result set but did not use an index.
      (See also the mysqld start option <literal>--log-queries-not-using-indexes</literal>).
     </simpara>
     <note>
      <simpara>
       Those queries can be reported via an exception by calling
       <code>mysqli_report(MYSQLI_REPORT_INDEX);</code>.
       It is possible to have them be reported via a warning instead by calling
       <code>mysqli_report(MYSQLI_REPORT_INDEX ^ MYSQLI_REPORT_STRICT);</code>.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.bad-index-used">
    <term><literal>bad_index_used</literal></term>
    <listitem>
     <simpara>
      Number of queries that have generated a result set and did not use a good index.
      (See also the mysqld start option <literal>--log-slow-queries</literal>).
     </simpara>
     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.no-index-used')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.slow-queries">
    <term><literal>slow_queries</literal></term>
    <listitem>
     <simpara>
      SQL statements that took more than <literal>long_query_time</literal>
      seconds to execute and required at least
      <literal>min_examined_row_limit</literal> rows to be examined.
     </simpara>
     <caution>
      <simpara>
       Not reported through <function>mysqli_report</function>.
      </simpara>
     </caution>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.buffered-sets">
    <term><literal>buffered_sets</literal></term>
    <listitem>
     <simpara>
      Number of buffered result sets returned by normal
      (i.e. not via a prepared statement) queries.
     </simpara>
     <para>
      Examples of API calls that will buffer result sets on the client:
      <simplelist type="inline">
       <member><function>mysqli_query</function></member>
       <member><function>mysqli_store_result</function></member>
       <member><function>mysqli_stmt_get_result</function></member>
      </simplelist>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.unbuffered-sets">
    <term><literal>unbuffered_sets</literal></term>
    <listitem>
     <simpara>
      Number of unbuffered result sets returned by normal
      (i.e. not via a prepared statement) queries.
     </simpara>
     <para>
      Examples of API calls that will not buffer result sets on the client:
      <simplelist type="inline">
       <member><function>mysqli_use_result</function></member>
      </simplelist>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.ps-buffered-sets">
    <term><literal>ps_buffered_sets</literal></term>
    <listitem>
     <simpara>
      Number of buffered result sets returned by prepared statements.
     </simpara>
     <para>
      Examples of API calls that will buffer result sets on the client:
      <simplelist type="inline">
       <member><function>mysqli_stmt_store_result</function></member>
      </simplelist>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.ps-unbuffered-sets">
    <term><literal>ps_unbuffered_sets</literal></term>
    <listitem>
     <simpara>
      Number of unbuffered result sets returned by prepared statements.
     </simpara>
     <simpara>
      By default prepared statements are unbuffered,
      thus most prepared statements will be accounted in this statistic.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.flushed-normal-sets">
    <term><literal>flushed_normal_sets</literal></term>
    <listitem>
     <simpara>
      Number of result sets returned by normal
      (i.e. not via a prepared statement) queries
      with unread data that have been silently flushed.
     </simpara>

     <note>
      <simpara>
       Flushing happens only with unbuffered result sets.
      </simpara>
      <simpara>
       Unbuffered result sets must be fetched completely before a new query can
       be run on the connection otherwise MySQL will throw an error.
       If the application does not fetch all rows from an unbuffered result set,
       mysqlnd does implicitly fetch the result set to clear the line.
      </simpara>
      <simpara>
       See also <literal>rows_skipped_normal</literal>, <literal>rows_skipped_ps</literal>.
      </simpara>
      <para>
       Some possible causes for an implicit flush:
       <itemizedlist>
        <listitem>
         <simpara>
          Faulty client application
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          Client stopped reading after it found what it was looking for
          but has made MySQL calculate more records than needed
         </simpara>
        </listitem>
        <listitem>
         <simpara>
          Client application has stopped unexpectedly
         </simpara>
        </listitem>
       </itemizedlist>
      </para>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.flushed-ps-sets">
    <term><literal>flushed_ps_sets</literal></term>
    <listitem>
     <simpara>
      Number of result sets from prepared statements
      with unread data that have been silently flushed.
     </simpara>

     <xi:include xpointer="xmlns(db=http://docbook.org/ns/docbook) xpointer(id('mysqlnd.stats.statistics.flushed-normal-sets')/db:listitem/db:note)">
      <xi:fallback/>
     </xi:include>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.ps-prepared-never-executed">
    <term><literal>ps_prepared_never_executed</literal></term>
    <listitem>
     <simpara>
      Number of statements prepared but never executed.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.ps-prepared-once-executed">
    <term><literal>ps_prepared_once_executed</literal></term>
    <listitem>
     <simpara>
      Number of prepared statements executed only once.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-server-normal">
    <term><literal>rows_fetched_from_server_normal</literal></term>
    <term><literal>rows_fetched_from_server_ps</literal></term>
    <listitem>
     <simpara>
      Total number of result set rows fetched from the server.
      This includes the rows which were not read by the client but
      had been implicitly fetched due to flushed unbuffered result sets.
     </simpara>
     <simpara>
      See also <literal>packets_received_rset_row</literal>.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-buffered-from-server-normal">
    <term><literal>rows_buffered_from_client_normal</literal></term>
    <listitem>
     <simpara>
      Total number of buffered rows originating from a normal query.
     </simpara>
     <simpara>
      This is the number of rows that have been fetched from MySQL and buffered on client.
     </simpara>
     <para>
      Examples of queries that will buffer results:
      <simplelist>
       <member><function>mysqli_query</function></member>
       <member><function>mysqli_store_result</function></member>
      </simplelist>
     </para>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-buffered-from-server-ps">
    <term><literal>rows_buffered_from_server_ps</literal></term>
    <listitem>
     <simpara>
      Same as <literal>rows_buffered_from_client_normal</literal>
      but for prepared statements.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-client-normal-buffered">
    <term><literal>rows_fetched_from_client_normal_buffered</literal></term>
    <listitem>
     <simpara>
      Total number of rows fetched by the client from a buffered result set
      created by a normal query.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-client-ps-buffered">
    <term><literal>rows_fetched_from_client_ps_buffered</literal></term>
    <listitem>
     <simpara>
      Total number of rows fetched by the client from a buffered result set
      created by a prepared statement.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-client-normal-unbuffered">
    <term><literal>rows_fetched_from_client_normal_unbuffered</literal></term>
    <listitem>
     <simpara>
      Total number of rows fetched by the client from an unbuffered result set
      created by a normal query.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-client-ps-unbuffered">
    <term><literal>rows_fetched_from_client_ps_unbuffered</literal></term>
    <listitem>
     <simpara>
      Total number of rows fetched by the client from an unbuffered result set
      created by a prepared statement.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.rows-fetched-from-client-ps-cursor">
    <term><literal>rows_fetched_from_client_ps_cursor</literal></term>
    <listitem>
     <simpara>
      Total number of rows fetch by the client from a cursor created by a
      prepared statement.
     </simpara>
    </listitem>
   </varlistentry>

   <!-- TODO: This seems to actually be supported, check and document -->
   <varlistentry xml:id="mysqlnd.stats.statistics.rows-skipped-normal">
    <term><literal>rows_skipped_normal</literal></term>
    <term><literal>rows_skipped_ps</literal></term>
    <listitem>
     <simpara>
      Reserved for future use (currently not supported).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.copy-on-write">
    <term><literal>copy_on_write_saved</literal></term>
    <term><literal>copy_on_write_performed</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      With mysqlnd, variables returned by the extensions point into mysqlnd
      internal network result buffers.
      If the data are not changed, the fetched data is kept only once in memory.
      However, any modification to the data will require mysqlnd to perform
      a copy-on-write operation.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.free-result">
    <term><literal>explicit_free_result</literal></term>
    <term><literal>implicit_free_result</literal></term>
    <listitem>
     <simpara>
      This is a connection and process level scope statistic.
     </simpara>
     <simpara>
      Total number of freed result sets.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-null">
    <term><literal>proto_text_fetched_null</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_NULL</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-null">
    <term><literal>proto_binary_fetched_null</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_NULL</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-bit">
    <term><literal>proto_text_fetched_bit</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_BIT</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-bit">
    <term><literal>proto_binary_fetched_bit</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_BIT</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-tinyint">
    <term><literal>proto_text_fetched_tinyint</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TINY</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-tinyint">
    <term><literal>proto_binary_fetched_tinyint</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TINY</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-short">
    <term><literal>proto_text_fetched_short</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_SHORT</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-short">
    <term><literal>proto_binary_fetched_short</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_SHORT</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-int24">
    <term><literal>proto_text_fetched_int24</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_INT24</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-int24">
    <term><literal>proto_binary_fetched_int24</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_INT24</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-int">
    <term><literal>proto_text_fetched_int</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_LONG</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-int">
    <term><literal>proto_binary_fetched_int</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_LONG</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-bigint">
    <term><literal>proto_text_fetched_bigint</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_LONGLONG</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-bigint">
    <term><literal>proto_binary_fetched_bigint</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_LONGLONG</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-decimal">
    <term><literal>proto_text_fetched_decimal</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DECIMAL</literal>, or <literal>MYSQL_TYPE_NEWDECIMAL</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-decimal">
    <term><literal>proto_binary_fetched_decimal</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DECIMAL</literal>, or <literal>MYSQL_TYPE_NEWDECIMAL</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-float">
    <term><literal>proto_text_fetched_float</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_FLOAT</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-float">
    <term><literal>proto_binary_fetched_float</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_FLOAT</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-double">
    <term><literal>proto_text_fetched_double</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DOUBLE</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-double">
    <term><literal>proto_binary_fetched_double</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DOUBLE</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-date">
    <term><literal>proto_text_fetched_date</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DATE</literal>, or <literal>MYSQL_TYPE_NEWDATE</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-date">
    <term><literal>proto_binary_fetched_date</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DATE</literal>, or <literal>MYSQL_TYPE_NEWDATE</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-year">
    <term><literal>proto_text_fetched_year</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_YEAR</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-year">
    <term><literal>proto_binary_fetched_year</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_YEAR</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-time">
    <term><literal>proto_text_fetched_time</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TIME</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-time">
    <term><literal>proto_binary_fetched_time</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TIME</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-datetime">
    <term><literal>proto_text_fetched_datetime</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DATETIME</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-datetime">
    <term><literal>proto_binary_fetched_datetime</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_DATETIME</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-timestamp">
    <term><literal>proto_text_fetched_timestamp</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TIMESTAMP</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-timestamp">
    <term><literal>proto_binary_fetched_timestamp</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TIMESTAMP</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-string">
    <term><literal>proto_text_fetched_string</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_STRING</literal>, <literal>MYSQL_TYPE_VARSTRING</literal>, or <literal>MYSQL_TYPE_VARCHAR</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-string">
    <term><literal>proto_binary_fetched_string</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_STRING</literal>, <literal>MYSQL_TYPE_VARSTRING</literal>, or <literal>MYSQL_TYPE_VARCHAR</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-blob">
    <term><literal>proto_text_fetched_blob</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TINY_BLOB</literal>,
      <literal>MYSQL_TYPE_MEDIUM_BLOB</literal>,
      <literal>MYSQL_TYPE_LONG_BLOB</literal>,
      or <literal>MYSQL_TYPE_BLOB</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-blob">
    <term><literal>proto_binary_fetched_blob</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_TINY_BLOB</literal>,
      <literal>MYSQL_TYPE_MEDIUM_BLOB</literal>,
      <literal>MYSQL_TYPE_LONG_BLOB</literal>,
      or <literal>MYSQL_TYPE_BLOB</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-enum">
    <term><literal>proto_text_fetched_enum</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_ENUM</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-enum">
    <term><literal>proto_binary_fetched_enum</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_ENUM</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-set">
    <term><literal>proto_text_fetched_set</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_SET</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-set">
    <term><literal>proto_binary_fetched_set</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_SET</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-geometry">
    <term><literal>proto_text_fetched_geometry</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_GEOMETRY</literal>
      fetched from a normal query (MySQL text protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-geometry">
    <term><literal>proto_binary_fetched_geometry</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_GEOMETRY</literal>
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-text-fetched-other">
    <term><literal>proto_text_fetched_other</literal></term>
    <listitem>
     <simpara>
      Total number of columns of types
      <literal>MYSQL_TYPE_<replaceable>*</replaceable></literal>
      not listed previously
      fetched from a normal query (MySQL text protocol).
     </simpara>
     <note>
      <simpara>
       In theory, this should always be <literal>0</literal>.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.proto-binary-fetched-other">
    <term><literal>proto_binary_fetched_other</literal></term>
    <listitem>
     <simpara>
      Total number of columns of type
      <literal>MYSQL_TYPE_<replaceable>*</replaceable></literal>
      not listed previously
      fetched from a prepared statement (MySQL binary protocol).
     </simpara>
     <note>
      <simpara>
       In theory, this should always be <literal>0</literal>.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

  </variablelist>

  <variablelist>
   <title>Connection Related Statistics</title>

   <varlistentry xml:id="mysqlnd.stats.statistics.connect-success">
    <term><literal>connect_success</literal></term>
    <listitem>
     <simpara>
      Total number of successful connection attempts.
     </simpara>
     <note>
      <simpara>
       <literal>connect_success</literal> holds the sum of successful
       persistent and non-persistent connection attempts.
       Therefore, the number of successful non-persistent connection attempts
       is <literal>connect_success - pconnect_success</literal>.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.pconnect-success">
    <term><literal>pconnect_success</literal></term>
    <listitem>
     <simpara>
      Total number of successful persistent connection attempts.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.connect-failure">
    <term><literal>connect_failure</literal></term>
    <listitem>
     <simpara>
      Total number of failed connection attempts.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.reconnect">
    <term><literal>reconnect</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.active-connections">
    <term><literal>active_connections</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      Total number of active persistent and non-persistent connections.
     </simpara>
     <note>
      <simpara>
       The total number of active non-persistent connections is
       <literal>active_connections - active_persistent_connections</literal>.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.active-persistent-connections">
    <term><literal>active_persistent_connections</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      Total number of active persistent connections.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.explicit-close">
    <term><literal>explicit_close</literal></term>
    <listitem>
     <simpara>
      Total number of explicitly closed connections.
     </simpara>
     <example>
      <title>Examples of code snippets that cause an explicit close</title>
      <itemizedlist>
       <listitem>
        <programlisting>
<![CDATA[
$link = new mysqli(/* ... */);
$link->close(/* ... */);
]]>
        </programlisting>
       </listitem>
       <listitem>
        <programlisting>
<![CDATA[
$link = new mysqli(/* ... */);
$link->connect(/* ... */);
]]>
        </programlisting>
       </listitem>
      </itemizedlist>
     </example>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.implicit-close">
    <term><literal>implicit_close</literal></term>
    <listitem>
     <simpara>
      Total number of implicitly closed connections.
     </simpara>
     <example>
      <title>Examples of code snippets that cause an implicit close</title>
      <itemizedlist>
       <listitem>
        <programlisting>
<![CDATA[
$link = new mysqli(/* ... */);
$link->real_connect(/* ... */);
]]>
        </programlisting>
       </listitem>
       <listitem>
        <programlisting>
         <code>unset($link)</code>
        </programlisting>
       </listitem>
       <listitem>
        <simpara>
         Persistent connection: pooled connection has been created with
         real_connect and there may be unknown options set - close
         implicitly to avoid returning a connection with unknown options
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         Persistent connection: ping/change_user fails and ext/mysqli
         closes the connection
        </simpara>
       </listitem>
       <listitem>
        <simpara>
         End of script execution: close connections that have not been
         closed by the user
        </simpara>
       </listitem>
      </itemizedlist>
     </example>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.disconnect-close">
    <term><literal>disconnect_close</literal></term>
    <listitem>
     <simpara>
      Connection failures indicated by the C API call
      <literal>mysql_real_connect</literal> during an attempt to
      establish a connection.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.in-middle-of-command-close">
    <term><literal>in_middle_of_command_close</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      A connection has been closed in the middle of a command execution
      (outstanding result sets not fetched, after sending a query and
      before retrieving an answer, while fetching data, while
      transferring data with LOAD DATA).
     </simpara>
     <warning>
      <simpara>
       Unless asynchronous queries are used,
       this should only happen if the PHP application terminated unexpectedly,
       and PHP shuts down the connection automatically.
      </simpara>
     </warning>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.init-command-executed-count">
    <term><literal>init_command_executed_count</literal></term>
    <listitem>
     <simpara>
      Total number of init command executions.
      For example: <code>mysqli_options(MYSQLI_INIT_COMMAND , $value)</code>.
     </simpara>
     <simpara>
      The number of successful executions is
      <literal>init_command_executed_count - init_command_failed_count</literal>.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.init-command-failed-count">
    <term><literal>init_command_failed_count</literal></term>
    <listitem>
     <simpara>
      Total number of failed init commands.
     </simpara>
    </listitem>
   </varlistentry>
  </variablelist>

  <variablelist>
   <title><literal>COM_*</literal> Command Related Statistics</title>

   <varlistentry xml:id="mysqlnd.stats.statistics.com">
    <term><literal>com_quit</literal></term>
    <term><literal>com_init_db</literal></term>
    <term><literal>com_query</literal></term>
    <term><literal>com_field_list</literal></term>
    <term><literal>com_create_db</literal></term>
    <term><literal>com_drop_db</literal></term>
    <term><literal>com_refresh</literal></term>
    <term><literal>com_shutdown</literal></term>
    <term><literal>com_statistics</literal></term>
    <term><literal>com_process_info</literal></term>
    <term><literal>com_connect</literal></term>
    <term><literal>com_process_kill</literal></term>
    <term><literal>com_debug</literal></term>
    <term><literal>com_ping</literal></term>
    <term><literal>com_time</literal></term>
    <term><literal>com_delayed_insert</literal></term>
    <term><literal>com_change_user</literal></term>
    <term><literal>com_binlog_dump</literal></term>
    <term><literal>com_table_dump</literal></term>
    <term><literal>com_connect_out</literal></term>
    <term><literal>com_register_slave</literal></term>
    <term><literal>com_stmt_prepare</literal></term>
    <term><literal>com_stmt_execute</literal></term>
    <term><literal>com_stmt_send_long_data</literal></term>
    <term><literal>com_stmt_close</literal></term>
    <term><literal>com_stmt_reset</literal></term>
    <term><literal>com_stmt_set_option</literal></term>
    <term><literal>com_stmt_fetch</literal></term>
    <term><literal>com_daemon</literal></term>
    <listitem>
     <simpara>
      Total number of attempts to send a certain <literal>COM_*</literal>
      command from PHP to MySQL.
     </simpara>
     <simpara>
      The statistics are incremented after checking the line and immediately
      before sending the corresponding MySQL client server protocol packet.
     </simpara>
     <caution>
      <simpara>
       If MySQLnd fails to send the packet over the wire the statistics will not be decremented.
       In case of a failure MySQLnd emits a PHP warning
       <quote>Error while sending %s packet. PID=%d.</quote>
      </simpara>
     </caution>

     <example>
      <title>Usage examples</title>
      <itemizedlist>
       <listitem>
        <para>
         Check if PHP sends certain commands to MySQL, for example,
         check if a client sends <literal>COM_PROCESS_KILL</literal>
        </para>
       </listitem>
       <listitem>
        <para>
         Calculate the average number of prepared statement executions
         by comparing <literal>COM_EXECUTE</literal> with
         <literal>COM_PREPARE</literal>
        </para>
       </listitem>
       <listitem>
        <para>
         Check if PHP has run any non-prepared SQL statements by
         checking if <literal>COM_QUERY</literal> is zero
        </para>
       </listitem>
       <listitem>
        <para>
         Identify PHP scripts that run an excessive number of SQL
         statements by checking <literal>COM_QUERY</literal> and
         <literal>COM_EXECUTE</literal>
        </para>
       </listitem>
      </itemizedlist>
     </example>
    </listitem>
   </varlistentry>
  </variablelist>

  <variablelist>
   <title>Miscellaneous Statistics</title>

   <varlistentry xml:id="mysqlnd.stats.statistics.stmt-close">
    <term><literal>explicit_stmt_close</literal></term>
    <term><literal>implicit_stmt_close</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      Total number of closed prepared statements.
     </simpara>
     <note>
      <simpara>
       A prepared statement is always explicitly closed. The only time it's closed implicitly is when preparing it fails.
      </simpara>
     </note>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.memory-management">
    <term><literal>mem_emalloc_count</literal></term>
    <term><literal>mem_emalloc_ammount</literal></term>
    <term><literal>mem_ecalloc_count</literal></term>
    <term><literal>mem_ecalloc_ammount</literal></term>
    <term><literal>mem_realloc_count</literal></term>
    <term><literal>mem_realloc_ammount</literal></term>
    <term><literal>mem_efree_count</literal></term>
    <term><literal>mem_malloc_count</literal></term>
    <term><literal>mem_malloc_ammount</literal></term>
    <term><literal>mem_calloc_count</literal></term>
    <term><literal>mem_calloc_ammount</literal></term>
    <term><literal>mem_ealloc_count</literal></term>
    <term><literal>mem_ealloc_ammount</literal></term>
    <term><literal>mem_free_count</literal></term>
    <listitem>
     <simpara>
      This is a process level scope statistic.
     </simpara>
     <simpara>
      Memory management calls.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.command-buffer-too-small">
    <term><literal>command_buffer_too_small</literal></term>
    <!-- TODO: XInclude/sync description of INI setting
     ini.mysqlnd.net-cmd-buffer-size with this statistic -->
    <listitem>
     <simpara>
      Number of network command buffer extensions while sending commands from
      PHP to MySQL.
     </simpara>
     <simpara>
      MySQLnd allocates an internal command/network buffer of
      <link linkend="ini.mysqlnd.net-cmd-buffer-size">mysqlnd.net_cmd_buffer_size</link>
      bytes for every connection.
     </simpara>
     <simpara>
      If a MySQL Client Server protocol command,
      e.g. <literal>COM_QUERY</literal> (normal query),
      does not fit into the buffer,
      MySQLnd will grow the buffer to what is needed for sending the command.
      Whenever the buffer gets extended for one connection
      <literal>command_buffer_too_small</literal> will be incremented by one.
     </simpara>
     <simpara>
      If MySQLnd has to grow the buffer beyond its initial size of
      <link linkend="ini.mysqlnd.net-cmd-buffer-size">mysqlnd.net_cmd_buffer_size</link>
      bytes for almost every connection,
      considerations to increase the default size should be made to avoid
      re-allocations.
     </simpara>
    </listitem>
   </varlistentry>

   <varlistentry xml:id="mysqlnd.stats.statistics.connection-reused">
    <term><literal>connection_reused</literal></term>
    <listitem>
     <simpara>
      The total number of times a persistent connection has been reused.
     </simpara>
    </listitem>
   </varlistentry>
  </variablelist>
 </section>
</chapter>
<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
sgml-omittag:t
sgml-shorttag:t
sgml-minimize-attributes:nil
sgml-always-quote-attributes:t
sgml-indent-step:1
sgml-indent-data:t
indent-tabs-mode:nil
sgml-parent-document:nil
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
sgml-exposed-tags:nil
sgml-local-catalogs:nil
sgml-local-ecat-files:nil
End:
vim600: syn=xml fen fdm=syntax fdl=2 si
vim: et tw=78 syn=sgml
vi: ts=1 sw=1
-->