Skip to content

Commit a39a4e1

Browse files
authored
DOCSP-17115 bytesRead and bytesWritten Clarification (#768) (#787)
* DOCS-17115 byteRead expansion * DOCS-17115 bytesWritten text * DOCS-17115 vale check * DOCS-17115 vale check * DOCS-17115 vale check
1 parent 73083b1 commit a39a4e1

File tree

1 file changed

+30
-0
lines changed

1 file changed

+30
-0
lines changed

source/reference/database-profiler.txt

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -529,6 +529,25 @@ messages </reference/log-messages>` include
529529

530530
Number of bytes read by the operation from the disk to the cache.
531531

532+
Data read from disk into the cache includes everything needed
533+
to execute the query. If the data is already in the cache,
534+
then the number of bytes read from disk could be ``0``.
535+
536+
The number of bytes read from disk includes more than the
537+
queried documents:
538+
539+
* WiredTiger reads in units of pages and a page may contain one or
540+
several documents. If a document is in a page, all documents in that
541+
page are read into the cache and included in the ``bytesRead`` value.
542+
543+
* If the cache requires page management (such as eviction or rereads),
544+
the ``bytesRead`` value includes data read from disk
545+
in these operations.
546+
547+
* If the index is not in the cache or the index in the cache is stale,
548+
WiredTiger reads several internal and leaf pages from disk to
549+
reconstruct the index in cache.
550+
532551
.. data:: system.profile.storage.data.timeReadingMicros
533552

534553
.. versionadded:: 4.0.9
@@ -543,6 +562,17 @@ messages </reference/log-messages>` include
543562
Number of bytes written by the operation from the cache to the
544563
disk.
545564

565+
WiredTiger typically doesn't require the query to write to disk.
566+
Data modified by the query is written to an in-memory cache that
567+
WiredTiger flushes to disk as part an eviction or checkpoint
568+
operation. In such cases, ``bytesWritten`` shows as 0.
569+
570+
If the thread running the query requires forced page management
571+
(such as eviction), WiredTiger writes the page contents to disk.
572+
This flush likely includes data unrelated to changes made by the
573+
query itself, which can cause ``bytesWritten`` to show
574+
a higher value than expected.
575+
546576
.. data:: system.profile.storage.data.timeWritingMicros
547577

548578
.. versionadded:: 4.0.9

0 commit comments

Comments
 (0)