This commit moves the DB.FillPercent field to Bucket.FillPercent. This
allows the fill percentage to be specified per-bucket, per-tx. This
value is not persisted and should be set whenever using it.
This commit fixes a bug where a root split on a very large insert would
cause an overflow of the root node. The problem was that the new root
was not split when it was created so a new root with more than 64K child
nodes would overflow the page.count (uint16).
This fixes an issue where split nodes can be double spilled. This is typically
not noticable but it can have large effects when bulk inserting as double
spilled nodes will get added to the freelist which will grow quickly.
This commit fixes an issue where large nodes would take up most of
the insert time because the entire node size would be calculated to
check if it could fit in a page or not. This changes the behavior
so that a node's size is only calculated up to the size it needs to
check and then returns.
This commit adds the DB.NoSync flag to skip fsync() calls on each commit. This should only
be used for bulk loading as it can corrupt your database in the event of a system failure.
Initial tests show it can provide a 2x speed up for sequential inserts.
This commit changes TxStats.RebalanceTime to only update if there are nodes that have been
rebalanced. Previously, the RebalanceTime would include a small amount of time to check if
there were nodes to rebalance but this is confusing to users and not terribly helpful.
This commit adds a defer handler to ensure that transactions are always closed out - even
in the event of a panic within user code. It's recommended that applications always fail
in the event of a panic but some packages such as net/http will automatically recover
which is a problem (IHMO).
This commit is a backwards compatible change that allows the freelist to overflow the
page.count (uint16). It works by checking if the overflow will occur and marking the
page.count as 0xFFFF and setting the actual count to the first element of the freelist.
This approach was used because it's backwards compatible and it doesn't make sense to
change the data type of all page counts when only the freelist's page can overflow.
Fixes#192.
This commit fixes an issue on Windows where the database was doubling
when it was re-opened. This occurred because Windows has to truncate the
file to the mmap size and the mmap resizing code was doubling the size
whenever the DB size was at the next threshold. This has been changed so
that the DB size will double only when the DB size is above the next
threshold.
This commit adds a cache to the freelist which combines the available free pages and pending free pages in
a single map. This was added to improve performance where freelist.isFree() was consuming 70% of CPU time
for large freelists.
This commit adds an explicit DefaultOptions variable for additional documentation.
Open() can still be passed a nil options which will cause options to be change to
the DefaultOptions variable. This change also allows options to be set globally for
an application if more than one database is being opened in a process.
This commit also moves all errors to errors.go so that the godoc groups them together.