----- Original Message ----- From: "Thomas Steinmaurer" <t...@iblogmanager.com> To: "For discussion among Firebird Developers" <firebird-devel@lists.sourceforge.net> Sent: Tuesday, November 15, 2011 12:11 AM Subject: Re: [Firebird-devel] Trace API - What's the unit for number of (reads |fetches ...)
> Hi Vlad, > >>>>> as the subject says. What's the unit for the resulting values for number >>>>> of reads, writes, fetches, marks? Just want to be sure if a particular >>>>> result makes sense here. ;-) >>>> >>>> Same as for isql's statistics - number of operations. Note, we have >>>> no >>>> operations on group of pages, so, for ex. N writes means N times write >>>> and every write is length of one page. >>> >>> So, the numbers I see is number of pages? >> >> Yes >> >>> I have the following trace output for a select count(*) on a table with >>> ~100.000 records. >>> >>> ------------------------------------------------------------------------------- >>> select count(*) from accommodation >>> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ >>> PLAN (ACCOMMODATION NATURAL) >>> 1 records fetched >>> 81 ms, 7149 read(s), 214192 fetch(es) >>> >>> >>> If it is pages, then this would mean ~ 800MB (4K page size) fetched >>> from the cache? Does this make sense? >> >> Fetch is not a physical read. > > I know. I said fetched from the cache. > > This is more like reference. When Firebird need >> access to page buffer (to get record, for ex.) it asks page cache to "fetch" >> page >> buffer. If this buffer is not present at page cache, it will be read from >> disk first. >> >> In your example we see 7149 physical reads and 214192 times this pages >> was >> referenced by the engine. To read a record engine needs to access pointer >> page and >> (at least one) data page. You have ~100K records so we can explain ~200K >> fetches. > > Ok, but is there a way then to tell how many pages have been fetched > from the cache as the number above for fetched is more likely > "referenced" and not real number of pages fetched from memory? What do you understand under "fetched from memory" ? There is no operations like memmove or so on. Fetch is just : - find buffer by given page number - lock it - return it address Regards, Vlad ------------------------------------------------------------------------------ RSA(R) Conference 2012 Save $700 by Nov 18 Register now http://p.sf.net/sfu/rsa-sfdev2dev1 Firebird-Devel mailing list, web interface at https://lists.sourceforge.net/lists/listinfo/firebird-devel