You are viewing a plain text version of this content. The canonical link for it is here.
Posted to derby-user@db.apache.org by Andre Höing <an...@uni-paderborn.de> on 2006/02/17 16:30:11 UTC
Derby with fast transactions?
Hi derby-users,
I am using derby to save lots of RDFTriples at starting time. This is a
little bit too slow for me.
Is there the possability to accelerate this. Bevore I used MySql with
the MyISAM engine. Is there a simular engine for derby, too?
Thanks for the help.
Andre Höing
Re: Derby with fast transactions?
Posted by Mike Matrigali <mi...@sbcglobal.net>.
are you doing 1 insert per transaction or multiple inserts per
transaction?
Andre Höing wrote:
> Hi derby-users,
>
> I am using derby to save lots of RDFTriples at starting time. This is a
> little bit too slow for me.
> Is there the possability to accelerate this. Bevore I used MySql with
> the MyISAM engine. Is there a simular engine for derby, too?
>
> Thanks for the help.
>
> Andre Höing
>
>
Re: Derby with fast transactions?
Posted by Sunitha Kambhampati <ks...@gmail.com>.
Andre Höing wrote:
>>>
>>>
>>The property is derby.system.durability=test
>>http://db.apache.org/derby/docs/dev/tuning/rtunproperdurability.html
>>
>>
>>
>
>I tried the durability property, but I have not seen any improvement.
>
>I started my Application with argument: -Dderby.system.home and the new home
>directory has been created. I put there a file named derby.properties with the
>derby.system.durability=test entry.
>I also tried
>Properties p = System.getProperties();
>p.put("derby.system.durability", "test");
>
>Is this the wrong way to activate the property?
>
>
This property was added in 10.1. Which version of derby are you using ?.
If you set up the property in the derby.properties or as java property
using the -D option before booting derby, it should be picked up.
If you boot the database with this property set to test, the following
warning message is logged in the derby.log file:
WARNING: The database is booted with derby.system.durability=test.
In this mode, it is possible that database may not be able
to recover, committed transactions may be lost, and the database
may be in an inconsistent state. Please use this mode only when
these consequences are acceptable.
Can you check if this message is logged in the derby.log file. The
derby.log fle should be in the directory specified by -Dderby.system.home.
Thanks,
Sunitha.
Re: Derby with fast transactions?
Posted by Andre Höing <an...@uni-paderborn.de>.
Thomas Hallgren wrote:
> Andre Höing wrote:
>> Every time i get a single triple or a group of them from another node
>> in the
>> network (a DHT Network), I have to check if I already saved a Triple
>> with that
>> Subject Predicate and Object and if not I have to insert it.
>>
>> Thanks a lot for your help.
>>
> Make sure you have a combined unique constraint on the triple.Put the
> most unique column first in that constraint. Skip the check
> altogether. Simply insert the record. If it's a duplicate, the insert
> will fail on a unique key violation.
>
> Kind Regards,
> Thomas Hallgren
>
Thanks a lot. It works. Problem solved ;)
Regards,
Andre
Re: Derby with fast transactions?
Posted by Thomas Hallgren <th...@tada.se>.
Andre Höing wrote:
> Every time i get a single triple or a group of them from another node in the
> network (a DHT Network), I have to check if I already saved a Triple with that
> Subject Predicate and Object and if not I have to insert it.
>
> Thanks a lot for your help.
>
Make sure you have a combined unique constraint on the triple.Put the most unique column
first in that constraint. Skip the check altogether. Simply insert the record. If it's a
duplicate, the insert will fail on a unique key violation.
Kind Regards,
Thomas Hallgren
Re: Derby with fast transactions?
Posted by Andre Höing <an...@upb.de>.
Hi all,
Thanks for all the answers.
>
> Dyre.Tjeldvoll@... wrote:
>
> >Andre Höing <an...@...> writes:
> >
> >
> >
> >>Hi derby-users,
> >>
> >>I am using derby to save lots of RDFTriples at starting time. This is a
> >>little bit too slow for me.
> >>Is there the possability to accelerate this. Bevore I used MySql with
> >>the MyISAM engine. Is there a simular engine for derby, too?
> >>
> >>
> >
> >Not a similar engine, but you can set a property (can't remeber the
> >exact name, see the manual (tuning guide, I think)), that will let
> >transactions commit without flushing the log to disk. Must be used
> >with great care though, since you won't be able to do recovery.
> >
> >
> The property is derby.system.durability=test
> http://db.apache.org/derby/docs/dev/tuning/rtunproperdurability.html
>
I tried the durability property, but I have not seen any improvement.
I started my Application with argument: -Dderby.system.home and the new home
directory has been created. I put there a file named derby.properties with the
derby.system.durability=test entry.
I also tried
Properties p = System.getProperties();
p.put("derby.system.durability", "test");
Is this the wrong way to activate the property?
Has someone another idea to improve speed?
I have only one table with columns:
Subject varchar(255)
Predicate varchar(255)
Object varchar(255)
received BIGINT
timeout BIGINT
birthday BIGINT
Every time i get a single triple or a group of them from another node in the
network (a DHT Network), I have to check if I already saved a Triple with that
Subject Predicate and Object and if not I have to insert it.
Thanks a lot for your help.
Andre
Re: Derby with fast transactions?
Posted by Sunitha Kambhampati <ks...@gmail.com>.
Dyre.Tjeldvoll@Sun.COM wrote:
>Andre Höing <an...@uni-paderborn.de> writes:
>
>
>
>>Hi derby-users,
>>
>>I am using derby to save lots of RDFTriples at starting time. This is a
>>little bit too slow for me.
>>Is there the possability to accelerate this. Bevore I used MySql with
>>the MyISAM engine. Is there a simular engine for derby, too?
>>
>>
>
>Not a similar engine, but you can set a property (can't remeber the
>exact name, see the manual (tuning guide, I think)), that will let
>transactions commit without flushing the log to disk. Must be used
>with great care though, since you won't be able to do recovery.
>
>
The property is derby.system.durability=test
http://db.apache.org/derby/docs/dev/tuning/rtunproperdurability.html
"While performance is improved, note that under these conditions, a
commit no longer guarantees that the transaction's modification will
survive a system crash or JVM termination, the database may not recover
successfully upon restart, a near-full disk at runtime may cause
unexpected errors, and the database may be in an inconsistent state."
Please evaluate if this property makes sense for your application or not
before using it.
Sunitha.
Re: Derby with fast transactions?
Posted by Dy...@Sun.COM.
Andre Höing <an...@uni-paderborn.de> writes:
> Hi derby-users,
>
> I am using derby to save lots of RDFTriples at starting time. This is a
> little bit too slow for me.
> Is there the possability to accelerate this. Bevore I used MySql with
> the MyISAM engine. Is there a simular engine for derby, too?
Not a similar engine, but you can set a property (can't remeber the
exact name, see the manual (tuning guide, I think)), that will let
transactions commit without flushing the log to disk. Must be used
with great care though, since you won't be able to do recovery.
Also note that comparing Derby to MyISAM is an apples to oranges
comparison. The functionality, isolation and durbility
offered by Derby is similar to that offered by the InnoDB engine.
--
dt