Skip to content

Commit 70ec01d

Browse files
authored
DOCSP-17115 bytesRead and bytesWritten Clarification (#768)
* DOCS-17115 byteRead expansion * DOCS-17115 bytesWritten text * DOCS-17115 vale check * DOCS-17115 vale check * DOCS-17115 vale check
1 parent 538d413 commit 70ec01d

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
@@ -565,6 +565,25 @@ operation.
565565

566566
Number of bytes read by the operation from the disk to the cache.
567567

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

570589
.. versionadded:: 4.2 (*Also available starting in 4.0.9*)
@@ -579,6 +598,17 @@ operation.
579598
Number of bytes written by the operation from the cache to the
580599
disk.
581600

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

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

0 commit comments

Comments
 (0)