Subject | Re: [ib-support] When do FB/IB 'flush' to disk? |
---|---|
Author | Ivan Prenosil |
Post date | 2001-11-29T18:07:04Z |
From previous discussion I have impression that people think that with forced writes on
inserting 10 rows into table (in one transaction) will generate 10+ i/o operations, which imho is not true.
Each insert goes into FB cache (regardless of setting of forced writes).
Cache pages are written to file (send to OS to write them)
either when you commit (i.e. pages that depends on transaction beeing committed),
or when FB needs new page and cache is full.
Because several rows can fit on to one page, inserting 10 rows and committing
can cause e.g. writing only 1 data page and 1 header page.
When inserting large amount of data, they must be finally physically
written to file anyway, so the main difference between forced writes on
and off is that with forced writes off the OS is free to change order
of physical writes, thus (potentially) minimizing disk rattling.
The order of writes is crucial if you do not want corrupted database
and there is chance of server crash or power failure.
To make Windows flush its cache at some intervals is just hack
that give you false feeling of security (but yes, it slightly
decreases probability of db corruption when forced writes are off).
FB either have control over order of physical writes or not.
There is not anything between.
Thread for writing pages to disk when server is idle could be handy,
but such thread would not be probably activated when importing large amout
of data anyway.
Ivan
http://www.volny.cz/iprenosil/interbase
inserting 10 rows into table (in one transaction) will generate 10+ i/o operations, which imho is not true.
Each insert goes into FB cache (regardless of setting of forced writes).
Cache pages are written to file (send to OS to write them)
either when you commit (i.e. pages that depends on transaction beeing committed),
or when FB needs new page and cache is full.
Because several rows can fit on to one page, inserting 10 rows and committing
can cause e.g. writing only 1 data page and 1 header page.
When inserting large amount of data, they must be finally physically
written to file anyway, so the main difference between forced writes on
and off is that with forced writes off the OS is free to change order
of physical writes, thus (potentially) minimizing disk rattling.
The order of writes is crucial if you do not want corrupted database
and there is chance of server crash or power failure.
To make Windows flush its cache at some intervals is just hack
that give you false feeling of security (but yes, it slightly
decreases probability of db corruption when forced writes are off).
FB either have control over order of physical writes or not.
There is not anything between.
Thread for writing pages to disk when server is idle could be handy,
but such thread would not be probably activated when importing large amout
of data anyway.
Ivan
http://www.volny.cz/iprenosil/interbase