Optimize Performance
Database comes with default configuration
<?xml
version="1.0"?>
<Eloquera
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Cache IndexCacheSize="10000"
WriteThru="false"
IndexCleanerPeriod="100"
IndexCleanerBatchSize="100"
CleanerPeriod="100"
CleanerBatchSize="2000"
CommitSequenceMaxLength="2000"
ShallowReadThreshold="1000"
ShallowReadAhead="1000"
ReadAhead="20"
SaturationThreshold="10000"
MemoryFootPrint="1000"/>
<MemoryManager
Mode="1" />
<Server ServerPort="43962"
DatabasePath="c:\dev\db"
Trace="true"
InMemoryAllowed="true"
Secure="false"
AllowUsers=""
AllowGroups="Everyone"
SNMPAddress = "net.tcp://localhost:8523/SNMP"
AutoRecovery="false"
CallbackEnabled="false"
VarSectorSize="512"
IndexNodeSize="64"
StoredProceduresPath = ""/>
<SmartRuntime
Smart="true" />
<UserLogin
Enabled="false"
PasswordHash="l+on1aCwDrcZ5bGlv+fyyIlYkbuFIOxZFlFwIGKlms0CCwoGn9TZvM0E3Uksjwx64+/yv8nsaUajWLz1kyKG7A==" />
</Eloquera>
Some time people may feel that store or query is too slow, in this
case database configuration may need to be adjusted
Rules of thumb
- Many strings in the object – increase VarSectorSize
- Many indexed fields and have sufficient memory – increase IndexCacheSize, sometime IndexNodeSize shall be decreased to speed up things.
- Fast hard disk – decrease MemoryFootPrint (number > 100 is in KB,
<= 100 is in %)
- Many queries without index – increase ShallowReadAhead, decrease ShallowReadThreshold
Indexes for string also can be optimized by playing around with [Index] parameters.
Example
public class Movie
{
[Index(IsCaseSensitive = true, Culture = "en-US", MaxKeySize = 20)]
public string Title {get; set;}
[Index]
public string StudioName {get; set;}
[Index]
public DateTime DateReleased
{get; set; }
public double Budget{get; set;}
}
Here indexing speed for string fields and properties can be improved by not using culture
[Index(Culture = null)]