Subject | Re: [firebird-support] More on mon$page_reads and mon$page_fetches |
---|---|
Author | Dmitry Yemanov |
Post date | 2008-03-26T05:20:59Z |
precari0 wrote:
requests required a disk read to fill the page cache. The mentioned 98
requests don't necessarily mean different pages, some of them could be
different requests for the same page.
Usually, every record read from a table requires two page fetches
(pointer page and data page). So the above select should report about 20
fetches. Other ones could be related to both start/commit transaction
operations and the internal metadata selects performed by the engine.
management. Looks okay.
they're cached and no more extra selects are required.
Dmitry
>So we have 10 records in the table.
> SQL> insert into test(i) values (1);
> SQL> insert into test(i) values (2);
> SQL> insert into test(i) values (3);
> SQL> insert into test(i) values (4);
> SQL> insert into test(i) values (5);
> SQL> insert into test(i) values (6);
> SQL> insert into test(i) values (7);
> SQL> insert into test(i) values (8);
> SQL> insert into test(i) values (9);
> SQL> insert into test(i) values (0);
> 58 732It means there were 98 requests for page read access. 10 of those
>
> -- A total of 10 pages were read from disk and another 98 from memory.
requests required a disk read to fill the page cache. The mentioned 98
requests don't necessarily mean different pages, some of them could be
different requests for the same page.
Usually, every record read from a table requires two page fetches
(pointer page and data page). So the above select should report about 20
fetches. Other ones could be related to both start/commit transaction
operations and the internal metadata selects performed by the engine.
> 58 761This roughly means 20 fetches for data and 9 fetches for transaction
>
> -- Only 29 pages were read from memory.
management. Looks okay.
> -- Why so many memory reads on the previous select?Because the engine selected the necessary metadata. After the first run,
they're cached and no more extra selects are required.
> -- I tried the same test on a bigger database and the results are~800K * 2 = ~1.6M : yes, this is correct.
> really strange:
>
> SQL> select count(*) from bigtable;
> COUNT
> 825778
>
> 13405 1679681
>
> -- The page_reads value seems to be OK with the size of the table,
> but 1.6 milion page fetches?
Dmitry