Skip to content

Commit 2199ada

Browse files
authored
DOCSP-17115 bytesRead and bytesWritten Clarification (#768) (#784)
* DOCS-17115 byteRead expansion * DOCS-17115 bytesWritten text * DOCS-17115 vale check * DOCS-17115 vale check * DOCS-17115 vale check
1 parent 42dd629 commit 2199ada

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
@@ -563,6 +563,25 @@ operation.
563563

564564
Number of bytes read by the operation from the disk to the cache.
565565

566+
Data read from disk into the cache includes everything needed
567+
to execute the query. If the data is already in the cache,
568+
then the number of bytes read from disk could be ``0``.
569+
570+
The number of bytes read from disk includes more than the
571+
queried documents:
572+
573+
* WiredTiger reads in units of pages and a page may contain one or
574+
several documents. If a document is in a page, all documents in that
575+
page are read into the cache and included in the ``bytesRead`` value.
576+
577+
* If the cache requires page management (such as eviction or rereads),
578+
the ``bytesRead`` value includes data read from disk
579+
in these operations.
580+
581+
* If the index is not in the cache or the index in the cache is stale,
582+
WiredTiger reads several internal and leaf pages from disk to
583+
reconstruct the index in cache.
584+
566585
.. data:: system.profile.storage.data.timeReadingMicros
567586

568587
.. versionadded:: 4.2 (*Also available starting in 4.0.9*)
@@ -577,6 +596,17 @@ operation.
577596
Number of bytes written by the operation from the cache to the
578597
disk.
579598

599+
WiredTiger typically doesn't require the query to write to disk.
600+
Data modified by the query is written to an in-memory cache that
601+
WiredTiger flushes to disk as part an eviction or checkpoint
602+
operation. In such cases, ``bytesWritten`` shows as 0.
603+
604+
If the thread running the query requires forced page management
605+
(such as eviction), WiredTiger writes the page contents to disk.
606+
This flush likely includes data unrelated to changes made by the
607+
query itself, which can cause ``bytesWritten`` to show
608+
a higher value than expected.
609+
580610
.. data:: system.profile.storage.data.timeWritingMicros
581611

582612
.. versionadded:: 4.2 (*Also available starting in 4.0.9*)

0 commit comments

Comments
 (0)