When you have a database of several hundred GB, have you used the
ability to split it up? If so why and how, what considerations went
into the splitting decision?

I recall faintly that you had to implement remote database
functionality at one point (I even think that discussion is in the
mailing list somewhere). Was that done for this very project which is
using the big DB?


On Wed, May 13, 2009 at 4:08 PM, Alexander Burger <a...@software-lab.de> wro=
> Hi Kriangkrai,
>> 1. In FFI, it seems that 'boxCnt()' (not 'box()') must be used to
>> return a correct value, why?
> You are free to use both. 'box()' is the lowest level, it puts a pattern
> of 32 bits into a new cell.
> =A0 =A0 =A0 =A0 |
> =A0 =A0 =A0 =A0 V
> =A0 =A0 =A0+-----+-----+
> =A0 =A0 =A0| 32 =A0| =A0/ =A0|
> =A0 =A0 =A0+-----+-----+
> As I wrote in the last mail, the lowest bit in a number is the sign
> bit. 'boxCnt()' takes care of that, shifting the number left and
> inserting that bit.
> =A0 static inline any boxCnt(long n) {return box(n>=3D0? =A0n*2 : -n*2+1)=
>> =A0 =A0any f1(any ex) {return box(123);} =A0 //=3D> -61 in Lisp
> =A061 * 2 -> 122
> =A0plus sign bit -> 123
>> 2. Is whole database in database files is loaded into memory?
> No, this is usually not possible. In the project I'm currently working
> in, the databases have a size of several hundred gigabytes.
> Only when an object is accessed (value, property list etc.), it is
> automatically loaded into the Lisp heap as an "external" symbol.
>> 3. Is it possible to have the database file a text file (not binary),
>> may be a PicoLisp file (like Emacs config file is an Emacs Lisp file)?
>> So that the data can be manually edited by a text editor.
> The current database files are in a binary format (called "PLIO" for
> PicoLisp I/O). This is the same format as written and read by the 'pr'
> and 'rd' functions.
> A normal text file would be less efficient due to the necessary parsing,
> and theoretically possible, but is currently not implemented.
>> 4. Could you please explain "hook" in the database library (+Hook and
>> the "hook" arguments)?
> A hook is an object which contains object-local indexes.
> Normally, all objects in the database are searchable by one ore several
> criteria (name, number, address, other objects etc.). This is done via
> indexes, implemented with B-Trees, which originate in the database root
> object.
> But sometimes it is necessary to have indexes relative to some other
> object. Take, for example, a database of suppliers of products. Each
> supplier is an object in the database, having various attributes like
> name, address, telephone etc. Besides that, there are articles (items or
> products) associated with that supplier. Each article has a unique item
> number, but unique perhaps only in the context of that supplier, not
> globally. Thus, the index of article numbers will be local to that
> supplier. Each article has a (+Hook +Link) to the supplier and the item
> number will be hooked to that supplier.
> =A0 (rel sup (+Hook +Link) (+Supplier)) =A0# The link to the supplier in =
> =A0 (rel nr =A0(+Key +Number) sup) =A0 =A0 =A0 =A0 # The article number, =
hooked to 'sup'
> Cheers,
> - Alex
> --
> UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=3dunsubscribe
UNSUBSCRIBE: mailto:picol...@software-lab.de?subject=unsubscribe

Reply via email to