Subject RE: [firebird-support] Re: commit after insert is very slow
Author Slavomir Skopalik
Hi, I didn't read info about your HW, but it seems to be standart PC with
IDE (SATA) HDD.
You can use HW RAID controler with large cache with batery backup (write
back cache enabled).

Also you have to have separate HDD (RAID 1 on real server) for DB files.

Other ways means change your DB design or application.
One tip: insert more records together without commit and perform only one
commit at the end.

Slavek
Ing. Slavomir Skopalik
Jednatel spolecnosti
Elekt Labs s.r.o.
Chaloupky 158
783 72 Velky Tynec
Czech Republic
--------------------------------------------
Mobil: +420 724 207 851
icq:199 118 333
e-mail:skopalik@...
http://www.elektlabs.cz <http://www.elektlabs.cz/>






thanks ivan,

yes i just try with force write off, and yes now i have

Time to execute the sql: 16 ms
Indexed Read: 117
Non Indexed Read: 0
Inserts: 30
Updates: 0
Deletes: 30
Time to commit the data: 0

the commit is now very fast (in apparence) but in fact it's not really help
because if i execute five time the query, on the fifth (exactly on every
fifth execute) i have

Time to execute the sql: 0 ms
Indexed Read: 117
Non Indexed Read: 0
Inserts: 30
Updates: 0
Deletes: 30
Time to commit the data: 3202

:( it's mean if i m unlucky when i execute the query that it is the flush
time i loose :( i was thinking that the flush was done by a separate thread
and not by a "commit" thread

do you have any other idea how to speed up the commit ? the index is multi
column (6 at max) ... do you thing reduce the number of column can help ?

thanks you by advance

--- In firebird-support@ <mailto:firebird-support%40yahoogroups.com>
yahoogroups.com, "Ivan Prenosil" <Ivan.Prenosil@...> wrote:
>
> > when i execute some SQL, the time to execute the sql is very fast (16ms)
but the time to commit the data is very very slow (2293
> > ms, even some time more than 10 secondes !)
> >
> > Time to execute the sql: 16 ms
> > Indexed Read: 117
> > Non Indexed Read: 0
> > Inserts: 30
> > Updates: 0
> > Deletes: 30
> > Time to commit the data: 2293
> >
> > the tables where the record was inserted/deleted have lot of indexes
(around 30 index by table, and around 10 columns by table)
>
> On commit, every page in FB cache changed by your transaction
> (and depending) must be written to disk.
> FB keeps database in consistent state by writing pages in specific order,
> and setting Forced Writes On prevents OS from optimizing those writes.
> So, modifying tables with lots of indexes like yours causes
> heavy disk trashing and so is slow.
> You should reduce number of indexes,
> or (if you can take that risk) turn Forced Writes Off.
>
> Ivan
> http://www.volny <http://www.volny.cz/iprenosil/interbase/>
cz/iprenosil/interbase/
>





[Non-text portions of this message have been removed]